date-fns-tz
Advanced tools
Comparing version 0.1.2 to 1.0.0-beta.1
@@ -29,8 +29,5 @@ const path = require('path') | ||
{ | ||
fullPath: path.join(__dirname, 'Options.js') | ||
}, | ||
{ | ||
fullPath: path.join(__dirname, 'Locale.js') | ||
fullPath: path.join(__dirname, 'OptionsWithTZ.js') | ||
} | ||
] | ||
} |
@@ -278,3 +278,3 @@ import dateFnsFormat from 'date-fns/format' | ||
* @param {String} format - the string of tokens | ||
* @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} | ||
* @param {OptionsWithTZ} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} | ||
* @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link | ||
@@ -281,0 +281,0 @@ * https://date-fns.org/docs/toDate} |
@@ -66,3 +66,3 @@ import toInteger from 'date-fns/_lib/toInteger/index.js' | ||
* @param {Date|String|Number} argument - the value to convert | ||
* @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} | ||
* @param {OptionsWithTZ} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} | ||
* @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format | ||
@@ -69,0 +69,0 @@ * @param {String} [options.timeZone=''] - used to specify the IANA time zone offset of a date String. |
@@ -18,3 +18,3 @@ import tzParseTimezone from '../_lib/tzParseTimezone' | ||
* @param {String} timeZone - the time zone to get local time for, can be an offset or IANA time zone | ||
* @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} | ||
* @param {OptionsWithTZ} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} | ||
* @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} | ||
@@ -21,0 +21,0 @@ * @returns {Date} the new date with the equivalent time in the time zone |
@@ -18,3 +18,3 @@ import cloneObject from 'date-fns/_lib/cloneObject' | ||
* @param {String} timeZone - the time zone of this local time, can be an offset or IANA time zone | ||
* @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} | ||
* @param {OptionsWithTZ} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} | ||
* @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} | ||
@@ -21,0 +21,0 @@ * @returns {Date} the new date with the equivalent time in the time zone |
@@ -298,3 +298,3 @@ 'use strict'; | ||
* @param {String} format - the string of tokens | ||
* @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} | ||
* @param {OptionsWithTZ} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} | ||
* @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link | ||
@@ -301,0 +301,0 @@ * https://date-fns.org/docs/toDate} |
{ | ||
"name": "date-fns-tz", | ||
"version": "0.1.2", | ||
"version": "1.0.0-beta.1", | ||
"sideEffects": false, | ||
@@ -14,3 +14,3 @@ "description": "Time zone support for date-fns v2 with the browser Intl API", | ||
"module": "esm/index.js", | ||
"types": "typings.d.ts", | ||
"typings": "./typings.d.ts", | ||
"scripts": { | ||
@@ -17,0 +17,0 @@ "build": "./scripts/build/build.sh", |
@@ -83,3 +83,3 @@ 'use strict'; | ||
* @param {Date|String|Number} argument - the value to convert | ||
* @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} | ||
* @param {OptionsWithTZ} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} | ||
* @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format | ||
@@ -86,0 +86,0 @@ * @param {String} [options.timeZone=''] - used to specify the IANA time zone offset of a date String. |
// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it. | ||
import { Locale } from 'date-fns' | ||
// FP Interfaces | ||
@@ -29,3 +31,3 @@ | ||
type Options = { | ||
type OptionsWithTZ = { | ||
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | ||
@@ -42,40 +44,8 @@ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | ||
} | ||
type OptionsAliased = Options | ||
type OptionsWithTZAliased = OptionsWithTZ | ||
type Locale = { | ||
formatDistance: Function | ||
formatRelative: Function | ||
localize: { | ||
ordinalNumber: Function | ||
era: Function | ||
quarter: Function | ||
month: Function | ||
day: Function | ||
dayPeriod: Function | ||
} | ||
formatLong: Object | ||
date: Function | ||
time: Function | ||
dateTime: Function | ||
match: { | ||
ordinalNumber: Function | ||
era: Function | ||
quarter: Function | ||
month: Function | ||
day: Function | ||
dayPeriod: Function | ||
} | ||
options?: { | ||
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | ||
firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | ||
} | ||
} | ||
type LocaleAliased = Locale | ||
// Exported Type Aliases | ||
declare module 'date-fns-tz' { | ||
export type Options = OptionsAliased | ||
export type Locale = LocaleAliased | ||
export type OptionsWithTZ = OptionsWithTZAliased | ||
} | ||
@@ -89,3 +59,3 @@ | ||
format: string, | ||
options?: Options | ||
options?: OptionsWithTZ | ||
): string | ||
@@ -96,3 +66,6 @@ namespace format { | ||
function toDate(argument: Date | string | number, options?: Options): Date | ||
function toDate( | ||
argument: Date | string | number, | ||
options?: OptionsWithTZ | ||
): Date | ||
namespace toDate { | ||
@@ -105,3 +78,3 @@ | ||
timeZone: string, | ||
options?: Options | ||
options?: OptionsWithTZ | ||
): Date | ||
@@ -115,3 +88,3 @@ namespace utcToZonedTime { | ||
timeZone: string, | ||
options?: Options | ||
options?: OptionsWithTZ | ||
): Date | ||
@@ -192,3 +165,3 @@ namespace zonedTimeToUtc { | ||
const formatWithOptions: CurriedFn3< | ||
Options, | ||
OptionsWithTZ, | ||
string, | ||
@@ -207,3 +180,7 @@ Date | string | number, | ||
const toDateWithOptions: CurriedFn2<Options, Date | string | number, Date> | ||
const toDateWithOptions: CurriedFn2< | ||
OptionsWithTZ, | ||
Date | string | number, | ||
Date | ||
> | ||
namespace toDateWithOptions { | ||
@@ -219,3 +196,3 @@ | ||
const utcToZonedTimeWithOptions: CurriedFn3< | ||
Options, | ||
OptionsWithTZ, | ||
string, | ||
@@ -235,3 +212,3 @@ Date | string | number, | ||
const zonedTimeToUtcWithOptions: CurriedFn3< | ||
Options, | ||
OptionsWithTZ, | ||
string, | ||
@@ -372,3 +349,3 @@ Date | string | number, | ||
format: string, | ||
options?: Options | ||
options?: OptionsWithTZ | ||
): string | ||
@@ -379,3 +356,6 @@ namespace format { | ||
function toDate(argument: Date | string | number, options?: Options): Date | ||
function toDate( | ||
argument: Date | string | number, | ||
options?: OptionsWithTZ | ||
): Date | ||
namespace toDate { | ||
@@ -388,3 +368,3 @@ | ||
timeZone: string, | ||
options?: Options | ||
options?: OptionsWithTZ | ||
): Date | ||
@@ -398,3 +378,3 @@ namespace utcToZonedTime { | ||
timeZone: string, | ||
options?: Options | ||
options?: OptionsWithTZ | ||
): Date | ||
@@ -475,3 +455,3 @@ namespace zonedTimeToUtc { | ||
const formatWithOptions: CurriedFn3< | ||
Options, | ||
OptionsWithTZ, | ||
string, | ||
@@ -490,3 +470,7 @@ Date | string | number, | ||
const toDateWithOptions: CurriedFn2<Options, Date | string | number, Date> | ||
const toDateWithOptions: CurriedFn2< | ||
OptionsWithTZ, | ||
Date | string | number, | ||
Date | ||
> | ||
namespace toDateWithOptions { | ||
@@ -502,3 +486,3 @@ | ||
const utcToZonedTimeWithOptions: CurriedFn3< | ||
Options, | ||
OptionsWithTZ, | ||
string, | ||
@@ -518,3 +502,3 @@ Date | string | number, | ||
const zonedTimeToUtcWithOptions: CurriedFn3< | ||
Options, | ||
OptionsWithTZ, | ||
string, | ||
@@ -667,6 +651,6 @@ Date | string | number, | ||
format: string, | ||
options?: Options | ||
options?: OptionsWithTZ | ||
): string | ||
toDate(argument: Date | string | number, options?: Options): Date | ||
toDate(argument: Date | string | number, options?: OptionsWithTZ): Date | ||
@@ -676,3 +660,3 @@ utcToZonedTime( | ||
timeZone: string, | ||
options?: Options | ||
options?: OptionsWithTZ | ||
): Date | ||
@@ -683,4 +667,4 @@ | ||
timeZone: string, | ||
options?: Options | ||
options?: OptionsWithTZ | ||
): Date | ||
} |
@@ -35,3 +35,3 @@ 'use strict'; | ||
* @param {String} timeZone - the time zone to get local time for, can be an offset or IANA time zone | ||
* @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} | ||
* @param {OptionsWithTZ} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} | ||
* @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} | ||
@@ -38,0 +38,0 @@ * @returns {Date} the new date with the equivalent time in the time zone |
@@ -35,3 +35,3 @@ 'use strict'; | ||
* @param {String} timeZone - the time zone of this local time, can be an offset or IANA time zone | ||
* @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} | ||
* @param {OptionsWithTZ} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} | ||
* @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} | ||
@@ -38,0 +38,0 @@ * @returns {Date} the new date with the equivalent time in the time zone |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
169062
120
3027