@formatjs/intl-datetimeformat 4.2.2 → 4.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/lib/src/abstract/BasicFormatMatcher.d.ts +2 -2
- package/lib/src/abstract/BasicFormatMatcher.d.ts.map +1 -1
- package/lib/src/abstract/BasicFormatMatcher.js +1 -1
- package/lib/src/abstract/BestFitFormatMatcher.d.ts +3 -3
- package/lib/src/abstract/BestFitFormatMatcher.d.ts.map +1 -1
- package/lib/src/abstract/BestFitFormatMatcher.js +1 -1
- package/lib/src/abstract/DateTimeStyleFormat.d.ts +2 -2
- package/lib/src/abstract/DateTimeStyleFormat.d.ts.map +1 -1
- package/lib/src/abstract/FormatDateTimePattern.js +1 -1
- package/lib/src/abstract/InitializeDateTimeFormat.d.ts +2 -2
- package/lib/src/abstract/InitializeDateTimeFormat.d.ts.map +1 -1
- package/lib/src/abstract/InitializeDateTimeFormat.js +3 -3
- package/lib/src/abstract/ToDateTimeOptions.d.ts +1 -2
- package/lib/src/abstract/ToDateTimeOptions.d.ts.map +1 -1
- package/lib/src/abstract/skeleton.d.ts +2 -2
- package/lib/src/abstract/skeleton.d.ts.map +1 -1
- package/lib/src/abstract/skeleton.js +1 -1
- package/lib/src/core.d.ts +4 -4
- package/lib/src/core.d.ts.map +1 -1
- package/lib/src/core.js +1 -1
- package/lib/src/packer.js +2 -2
- package/lib/src/to_locale_string.d.ts +3 -4
- package/lib/src/to_locale_string.d.ts.map +1 -1
- package/package.json +3 -3
- package/polyfill-force.js +7 -7
- package/polyfill.iife.js +60 -60
- package/polyfill.js +8 -8
- package/src/abstract/BasicFormatMatcher.d.ts +2 -2
- package/src/abstract/BasicFormatMatcher.d.ts.map +1 -1
- package/src/abstract/BasicFormatMatcher.js +2 -2
- package/src/abstract/BestFitFormatMatcher.d.ts +3 -3
- package/src/abstract/BestFitFormatMatcher.d.ts.map +1 -1
- package/src/abstract/BestFitFormatMatcher.js +3 -3
- package/src/abstract/DateTimeStyleFormat.d.ts +2 -2
- package/src/abstract/DateTimeStyleFormat.d.ts.map +1 -1
- package/src/abstract/DateTimeStyleFormat.js +3 -3
- package/src/abstract/FormatDateTime.js +1 -1
- package/src/abstract/FormatDateTimePattern.js +3 -3
- package/src/abstract/FormatDateTimeRange.js +1 -1
- package/src/abstract/FormatDateTimeRangeToParts.js +1 -1
- package/src/abstract/FormatDateTimeToParts.js +2 -2
- package/src/abstract/InitializeDateTimeFormat.d.ts +2 -2
- package/src/abstract/InitializeDateTimeFormat.d.ts.map +1 -1
- package/src/abstract/InitializeDateTimeFormat.js +30 -30
- package/src/abstract/PartitionDateTimePattern.js +2 -2
- package/src/abstract/PartitionDateTimeRangePattern.js +9 -9
- package/src/abstract/ToDateTimeOptions.d.ts +1 -2
- package/src/abstract/ToDateTimeOptions.d.ts.map +1 -1
- package/src/abstract/ToDateTimeOptions.js +1 -1
- package/src/abstract/ToLocalTime.js +10 -10
- package/src/abstract/skeleton.d.ts +2 -2
- package/src/abstract/skeleton.d.ts.map +1 -1
- package/src/abstract/skeleton.js +3 -3
- package/src/core.d.ts +4 -4
- package/src/core.d.ts.map +1 -1
- package/src/core.js +43 -43
- package/src/packer.js +3 -3
- package/src/to_locale_string.d.ts +3 -4
- package/src/to_locale_string.d.ts.map +1 -1
- package/src/to_locale_string.js +2 -2
- package/test262-main.js +1 -1
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Formats } from '@formatjs/ecma402-abstract';
|
|
2
2
|
/**
|
|
3
3
|
* https://tc39.es/ecma402/#sec-basicformatmatcher
|
|
4
4
|
* @param options
|
|
5
5
|
* @param formats
|
|
6
6
|
*/
|
|
7
|
-
export declare function BasicFormatMatcher(options: DateTimeFormatOptions, formats: Formats[]): Formats;
|
|
7
|
+
export declare function BasicFormatMatcher(options: Intl.DateTimeFormatOptions, formats: Formats[]): Formats;
|
|
8
8
|
//# sourceMappingURL=BasicFormatMatcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BasicFormatMatcher.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/intl-datetimeformat/src/abstract/BasicFormatMatcher.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"BasicFormatMatcher.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/intl-datetimeformat/src/abstract/BasicFormatMatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAY,MAAM,4BAA4B,CAAA;AAW7D;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,IAAI,CAAC,qBAAqB,EACnC,OAAO,EAAE,OAAO,EAAE,GACjB,OAAO,CA2CT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
|
-
import { invariant
|
|
2
|
+
import { invariant } from '@formatjs/ecma402-abstract';
|
|
3
3
|
import { DATE_TIME_PROPS, additionPenalty, removalPenalty, longMorePenalty, shortMorePenalty, shortLessPenalty, longLessPenalty, } from './utils';
|
|
4
4
|
/**
|
|
5
5
|
* https://tc39.es/ecma402/#sec-basicformatmatcher
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Formats } from '@formatjs/ecma402-abstract';
|
|
2
2
|
/**
|
|
3
3
|
* Credit: https://github.com/andyearnshaw/Intl.js/blob/0958dc1ad8153f1056653ea22b8208f0df289a4e/src/12.datetimeformat.js#L611
|
|
4
4
|
* with some modifications
|
|
5
5
|
* @param options
|
|
6
6
|
* @param format
|
|
7
7
|
*/
|
|
8
|
-
export declare function bestFitFormatMatcherScore(options: DateTimeFormatOptions, format: Formats): number;
|
|
8
|
+
export declare function bestFitFormatMatcherScore(options: Intl.DateTimeFormatOptions, format: Formats): number;
|
|
9
9
|
/**
|
|
10
10
|
* https://tc39.es/ecma402/#sec-bestfitformatmatcher
|
|
11
11
|
* Just alias to basic for now
|
|
@@ -13,5 +13,5 @@ export declare function bestFitFormatMatcherScore(options: DateTimeFormatOptions
|
|
|
13
13
|
* @param formats
|
|
14
14
|
* @param implDetails Implementation details
|
|
15
15
|
*/
|
|
16
|
-
export declare function BestFitFormatMatcher(options: DateTimeFormatOptions, formats: Formats[]): Formats;
|
|
16
|
+
export declare function BestFitFormatMatcher(options: Intl.DateTimeFormatOptions, formats: Formats[]): Formats;
|
|
17
17
|
//# sourceMappingURL=BestFitFormatMatcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BestFitFormatMatcher.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/intl-datetimeformat/src/abstract/BestFitFormatMatcher.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"BestFitFormatMatcher.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/intl-datetimeformat/src/abstract/BestFitFormatMatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAqB,MAAM,4BAA4B,CAAA;AAmBtE;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,IAAI,CAAC,qBAAqB,EACnC,MAAM,EAAE,OAAO,GACd,MAAM,CA0CR;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,IAAI,CAAC,qBAAqB,EACnC,OAAO,EAAE,OAAO,EAAE,WAsDnB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
|
-
import { invariant
|
|
2
|
+
import { invariant } from '@formatjs/ecma402-abstract';
|
|
3
3
|
import { DATE_TIME_PROPS, removalPenalty, additionPenalty, differentNumericTypePenalty, longMorePenalty, shortMorePenalty, shortLessPenalty, longLessPenalty, } from './utils';
|
|
4
4
|
import { processDateTimePattern } from './skeleton';
|
|
5
5
|
function isNumericType(t) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function DateTimeStyleFormat(dateStyle: DateTimeFormatOptions['dateStyle'], timeStyle: DateTimeFormatOptions['timeStyle'], dataLocaleData: DateTimeFormatLocaleInternalData): Formats;
|
|
1
|
+
import { DateTimeFormatLocaleInternalData, Formats } from '@formatjs/ecma402-abstract';
|
|
2
|
+
export declare function DateTimeStyleFormat(dateStyle: Intl.DateTimeFormatOptions['dateStyle'], timeStyle: Intl.DateTimeFormatOptions['timeStyle'], dataLocaleData: DateTimeFormatLocaleInternalData): Formats;
|
|
3
3
|
//# sourceMappingURL=DateTimeStyleFormat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeStyleFormat.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/intl-datetimeformat/src/abstract/DateTimeStyleFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"DateTimeStyleFormat.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/intl-datetimeformat/src/abstract/DateTimeStyleFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAChC,OAAO,EAER,MAAM,4BAA4B,CAAA;AAEnC,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,IAAI,CAAC,qBAAqB,CAAC,WAAW,CAAC,EAClD,SAAS,EAAE,IAAI,CAAC,qBAAqB,CAAC,WAAW,CAAC,EAClD,cAAc,EAAE,gCAAgC,GAC/C,OAAO,CAuDT"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IntlDateTimeFormatInternal, DateTimeFormatLocaleInternalData } from '@formatjs/ecma402-abstract';
|
|
2
2
|
/**
|
|
3
3
|
* https://tc39.es/ecma402/#sec-initializedatetimeformat
|
|
4
4
|
* @param dtf DateTimeFormat
|
|
5
5
|
* @param locales locales
|
|
6
6
|
* @param opts options
|
|
7
7
|
*/
|
|
8
|
-
export declare function InitializeDateTimeFormat(dtf: Intl.DateTimeFormat, locales: string | string[] | undefined, opts: DateTimeFormatOptions | undefined, { getInternalSlots, availableLocales, localeData, getDefaultLocale, getDefaultTimeZone, relevantExtensionKeys, tzData, uppercaseLinks, }: {
|
|
8
|
+
export declare function InitializeDateTimeFormat(dtf: Intl.DateTimeFormat, locales: string | string[] | undefined, opts: Intl.DateTimeFormatOptions | undefined, { getInternalSlots, availableLocales, localeData, getDefaultLocale, getDefaultTimeZone, relevantExtensionKeys, tzData, uppercaseLinks, }: {
|
|
9
9
|
getInternalSlots(dtf: Intl.DateTimeFormat): IntlDateTimeFormatInternal;
|
|
10
10
|
availableLocales: Set<string>;
|
|
11
11
|
getDefaultLocale(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InitializeDateTimeFormat.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/intl-datetimeformat/src/abstract/InitializeDateTimeFormat.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"InitializeDateTimeFormat.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/intl-datetimeformat/src/abstract/InitializeDateTimeFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,0BAA0B,EAC1B,gCAAgC,EAOjC,MAAM,4BAA4B,CAAA;AAkDnC;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,EACtC,IAAI,EAAE,IAAI,CAAC,qBAAqB,GAAG,SAAS,EAC5C,EACE,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,MAAM,EACN,cAAc,GACf,EAAE;IACD,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,GAAG,0BAA0B,CAAA;IACtE,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC7B,gBAAgB,IAAI,MAAM,CAAA;IAC1B,kBAAkB,IAAI,MAAM,CAAA;IAC5B,qBAAqB,EAAE,MAAM,EAAE,CAAA;IAC/B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gCAAgC,GAAG,SAAS,CAAC,CAAA;IACxE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACvC,GACA,IAAI,CAAC,cAAc,CAoPrB"}
|
|
@@ -107,11 +107,11 @@ export function InitializeDateTimeFormat(dtf, locales, opts, _a) {
|
|
|
107
107
|
// @ts-expect-error
|
|
108
108
|
undefined);
|
|
109
109
|
var dataLocaleData = localeData[dataLocale];
|
|
110
|
-
invariant(!!dataLocaleData, "Missing locale data for "
|
|
110
|
+
invariant(!!dataLocaleData, "Missing locale data for ".concat(dataLocale));
|
|
111
111
|
var formats = dataLocaleData.formats[calendar];
|
|
112
112
|
// UNSPECCED: IMPLEMENTATION DETAILS
|
|
113
113
|
if (!formats) {
|
|
114
|
-
throw new RangeError("Calendar \""
|
|
114
|
+
throw new RangeError("Calendar \"".concat(calendar, "\" is not supported. Try setting \"calendar\" to 1 of the following: ").concat(Object.keys(dataLocaleData.formats).join(', ')));
|
|
115
115
|
}
|
|
116
116
|
var formatMatcher = GetOption(options, 'formatMatcher', 'string', ['basic', 'best fit'], 'best fit');
|
|
117
117
|
var dateStyle = GetOption(options, 'dateStyle', 'string', ['full', 'long', 'medium', 'short'], undefined);
|
|
@@ -138,7 +138,7 @@ export function InitializeDateTimeFormat(dtf, locales, opts, _a) {
|
|
|
138
138
|
var prop = DATE_TIME_PROPS_1[_i];
|
|
139
139
|
var p = opt[prop];
|
|
140
140
|
if (p !== undefined) {
|
|
141
|
-
throw new TypeError("Intl.DateTimeFormat can't set option "
|
|
141
|
+
throw new TypeError("Intl.DateTimeFormat can't set option ".concat(prop, " when ").concat(dateStyle ? 'dateStyle' : 'timeStyle', " is used"));
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
bestFormat = DateTimeStyleFormat(dateStyle, timeStyle, dataLocaleData);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { DateTimeFormatOptions } from '@formatjs/ecma402-abstract';
|
|
2
1
|
/**
|
|
3
2
|
* https://tc39.es/ecma402/#sec-todatetimeoptions
|
|
4
3
|
* @param options
|
|
5
4
|
* @param required
|
|
6
5
|
* @param defaults
|
|
7
6
|
*/
|
|
8
|
-
export declare function ToDateTimeOptions(options?: DateTimeFormatOptions | null, required?: string, defaults?: string): DateTimeFormatOptions;
|
|
7
|
+
export declare function ToDateTimeOptions(options?: Intl.DateTimeFormatOptions | null, required?: string, defaults?: string): Intl.DateTimeFormatOptions;
|
|
9
8
|
//# sourceMappingURL=ToDateTimeOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToDateTimeOptions.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/intl-datetimeformat/src/abstract/ToDateTimeOptions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ToDateTimeOptions.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/intl-datetimeformat/src/abstract/ToDateTimeOptions.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,GAAG,IAAI,EAC3C,QAAQ,CAAC,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,MAAM,GAChB,IAAI,CAAC,qBAAqB,CAqE5B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function processDateTimePattern(pattern: string, result?: Pick<DateTimeFormatOptions, 'weekday' | 'era' | 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second' | 'timeZoneName'> & {
|
|
1
|
+
import { Formats, RangePatternPart } from '@formatjs/ecma402-abstract';
|
|
2
|
+
export declare function processDateTimePattern(pattern: string, result?: Pick<Intl.DateTimeFormatOptions, 'weekday' | 'era' | 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second' | 'timeZoneName'> & {
|
|
3
3
|
hour12?: boolean;
|
|
4
4
|
}): [string, string];
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/intl-datetimeformat/src/abstract/skeleton.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/intl-datetimeformat/src/abstract/skeleton.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,gBAAgB,EAIjB,MAAM,4BAA4B,CAAA;AAkNnC,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,IAAI,CACX,IAAI,CAAC,qBAAqB,EACxB,SAAS,GACT,KAAK,GACL,MAAM,GACN,OAAO,GACP,KAAK,GACL,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,cAAc,CACjB,GAAG;IACF,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,GACA,CAAC,MAAM,EAAE,MAAM,CAAC,CA8BlB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,UAAU,GAAE,MAAiB,EAC7B,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACtC,sBAAsB,CAAC,EAAE,MAAM,GAC9B,OAAO,CAgDT;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,GACd,KAAK,CAAC,gBAAgB,CAAC,CAqBzB;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,gBAAgB,CAAC,CAgC1E"}
|
|
@@ -172,7 +172,7 @@ export function processDateTimePattern(pattern, result) {
|
|
|
172
172
|
// Apostrophe-escaped
|
|
173
173
|
.replace(/'(.*?)'/g, function (_, literal) {
|
|
174
174
|
literals.push(literal);
|
|
175
|
-
return "$$"
|
|
175
|
+
return "$$".concat(literals.length - 1, "$$");
|
|
176
176
|
})
|
|
177
177
|
.replace(DATE_TIME_REGEX, function (m) { return matchSkeletonPattern(m, result || {}); });
|
|
178
178
|
//Restore literals
|
package/lib/src/core.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DateTimeFormat as IDateTimeFormat, DateTimeFormatLocaleInternalData, UnpackedZoneData } from '@formatjs/ecma402-abstract';
|
|
2
2
|
import { PackedData, RawDateTimeLocaleData } from './types';
|
|
3
3
|
export interface DateTimeFormatConstructor {
|
|
4
|
-
new (locales?: string | string[], options?: DateTimeFormatOptions): IDateTimeFormat;
|
|
5
|
-
(locales?: string | string[], options?: DateTimeFormatOptions): IDateTimeFormat;
|
|
4
|
+
new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): IDateTimeFormat;
|
|
5
|
+
(locales?: string | string[], options?: Intl.DateTimeFormatOptions): IDateTimeFormat;
|
|
6
6
|
__addLocaleData(...data: RawDateTimeLocaleData[]): void;
|
|
7
|
-
supportedLocalesOf(locales: string | string[], options?: Pick<DateTimeFormatOptions, 'localeMatcher'>): string[];
|
|
7
|
+
supportedLocalesOf(locales: string | string[], options?: Pick<Intl.DateTimeFormatOptions, 'localeMatcher'>): string[];
|
|
8
8
|
getDefaultLocale(): string;
|
|
9
9
|
relevantExtensionKeys: string[];
|
|
10
10
|
__defaultLocale: string;
|
package/lib/src/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../../../../packages/intl-datetimeformat/src/core.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../../../../packages/intl-datetimeformat/src/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,cAAc,IAAI,eAAe,EAEjC,gCAAgC,EAChC,gBAAgB,EAIjB,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EAAC,UAAU,EAAE,qBAAqB,EAAC,MAAM,SAAS,CAAA;AAqGzD,MAAM,WAAW,yBAAyB;IACxC,KACE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EAC3B,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,GACnC,eAAe,CAAA;IAClB,CACE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EAC3B,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,GACnC,eAAe,CAAA;IAElB,eAAe,CAAC,GAAG,IAAI,EAAE,qBAAqB,EAAE,GAAG,IAAI,CAAA;IACvD,kBAAkB,CAChB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE,eAAe,CAAC,GAC1D,MAAM,EAAE,CAAA;IACX,gBAAgB,IAAI,MAAM,CAAA;IAC1B,qBAAqB,EAAE,MAAM,EAAE,CAAA;IAC/B,eAAe,EAAE,MAAM,CAAA;IACvB,iBAAiB,EAAE,MAAM,CAAA;IACzB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;IACtC,kBAAkB,IAAI,MAAM,CAAA;IAC5B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gCAAgC,CAAC,CAAA;IAC5D,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC7B,UAAU,EAAE,OAAO,CAAA;IACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAA;IAC1C,WAAW,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI,CAAA;CACjC;AAED,eAAO,MAAM,cAAc,2BA+BG,CAAA"}
|
package/lib/src/core.js
CHANGED
|
@@ -111,7 +111,7 @@ export var DateTimeFormat = function (locales, options) {
|
|
|
111
111
|
var internalSlots = getInternalSlots(this);
|
|
112
112
|
var dataLocale = internalSlots.dataLocale;
|
|
113
113
|
var dataLocaleData = DateTimeFormat.localeData[dataLocale];
|
|
114
|
-
invariant(dataLocaleData !== undefined, "Cannot load locale-dependent data for "
|
|
114
|
+
invariant(dataLocaleData !== undefined, "Cannot load locale-dependent data for ".concat(dataLocale, "."));
|
|
115
115
|
/** IMPL END */
|
|
116
116
|
};
|
|
117
117
|
// Static properties
|
package/lib/src/packer.js
CHANGED
|
@@ -8,8 +8,8 @@ export function pack(data) {
|
|
|
8
8
|
zone
|
|
9
9
|
], data.zones[zone].map(function (_a) {
|
|
10
10
|
var ts = _a[0], others = _a.slice(1);
|
|
11
|
-
return __spreadArray([ts === '' ? '' : ts.toString(36)], others).join(',');
|
|
12
|
-
})).join('|');
|
|
11
|
+
return __spreadArray([ts === '' ? '' : ts.toString(36)], others, true).join(',');
|
|
12
|
+
}), true).join('|');
|
|
13
13
|
}),
|
|
14
14
|
abbrvs: data.abbrvs.join('|'),
|
|
15
15
|
offsets: data.offsets.map(function (o) { return o.toString(36); }).join('|'),
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { DateTimeFormatOptions } from '@formatjs/ecma402-abstract';
|
|
2
1
|
/**
|
|
3
2
|
* Number.prototype.toLocaleString ponyfill
|
|
4
3
|
* https://tc39.es/ecma402/#sup-number.prototype.tolocalestring
|
|
5
4
|
*/
|
|
6
|
-
export declare function toLocaleString(x?: Date | number, locales?: string | string[], options?: DateTimeFormatOptions): string;
|
|
7
|
-
export declare function toLocaleDateString(x?: Date | number, locales?: string | string[], options?: DateTimeFormatOptions): string;
|
|
8
|
-
export declare function toLocaleTimeString(x?: Date | number, locales?: string | string[], options?: DateTimeFormatOptions): string;
|
|
5
|
+
export declare function toLocaleString(x?: Date | number, locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
|
|
6
|
+
export declare function toLocaleDateString(x?: Date | number, locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
|
|
7
|
+
export declare function toLocaleTimeString(x?: Date | number, locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
|
|
9
8
|
//# sourceMappingURL=to_locale_string.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to_locale_string.d.ts","sourceRoot":"","sources":["../../../../../../../packages/intl-datetimeformat/src/to_locale_string.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"to_locale_string.d.ts","sourceRoot":"","sources":["../../../../../../../packages/intl-datetimeformat/src/to_locale_string.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EAC3B,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,GACnC,MAAM,CAGR;AAED,wBAAgB,kBAAkB,CAChC,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EAC3B,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,GACnC,MAAM,CAMR;AAED,wBAAgB,kBAAkB,CAChC,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EAC3B,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,GACnC,MAAM,CAMR"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/intl-datetimeformat",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.6",
|
|
4
4
|
"description": "Intl.DateTimeFormat polyfill",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"homepage": "https://github.com/formatjs/formatjs#readme",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@formatjs/ecma402-abstract": "1.
|
|
26
|
-
"@formatjs/intl-localematcher": "0.2.
|
|
25
|
+
"@formatjs/ecma402-abstract": "1.11.0",
|
|
26
|
+
"@formatjs/intl-localematcher": "0.2.21",
|
|
27
27
|
"tslib": "^2.1.0"
|
|
28
28
|
}
|
|
29
29
|
}
|
package/polyfill-force.js
CHANGED
|
@@ -3,19 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
var _1 = require("./");
|
|
4
4
|
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
5
5
|
var to_locale_string_1 = require("./src/to_locale_string");
|
|
6
|
-
ecma402_abstract_1.defineProperty(Intl, 'DateTimeFormat', { value: _1.DateTimeFormat });
|
|
7
|
-
ecma402_abstract_1.defineProperty(Date.prototype, 'toLocaleString', {
|
|
6
|
+
(0, ecma402_abstract_1.defineProperty)(Intl, 'DateTimeFormat', { value: _1.DateTimeFormat });
|
|
7
|
+
(0, ecma402_abstract_1.defineProperty)(Date.prototype, 'toLocaleString', {
|
|
8
8
|
value: function toLocaleString(locales, options) {
|
|
9
|
-
return to_locale_string_1.toLocaleString(this, locales, options);
|
|
9
|
+
return (0, to_locale_string_1.toLocaleString)(this, locales, options);
|
|
10
10
|
},
|
|
11
11
|
});
|
|
12
|
-
ecma402_abstract_1.defineProperty(Date.prototype, 'toLocaleDateString', {
|
|
12
|
+
(0, ecma402_abstract_1.defineProperty)(Date.prototype, 'toLocaleDateString', {
|
|
13
13
|
value: function toLocaleDateString(locales, options) {
|
|
14
|
-
return to_locale_string_1.toLocaleDateString(this, locales, options);
|
|
14
|
+
return (0, to_locale_string_1.toLocaleDateString)(this, locales, options);
|
|
15
15
|
},
|
|
16
16
|
});
|
|
17
|
-
ecma402_abstract_1.defineProperty(Date.prototype, 'toLocaleTimeString', {
|
|
17
|
+
(0, ecma402_abstract_1.defineProperty)(Date.prototype, 'toLocaleTimeString', {
|
|
18
18
|
value: function toLocaleTimeString(locales, options) {
|
|
19
|
-
return to_locale_string_1.toLocaleTimeString(this, locales, options);
|
|
19
|
+
return (0, to_locale_string_1.toLocaleTimeString)(this, locales, options);
|
|
20
20
|
},
|
|
21
21
|
});
|