@formatjs/intl-datetimeformat 6.12.6 → 6.14.0
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/add-all-tz.js +212 -212
- package/add-golden-tz.js +134 -134
- package/lib/src/abstract/FormatDateTimePattern.d.ts +1 -1
- package/lib/src/abstract/FormatDateTimePattern.js +5 -5
- package/lib/src/data/all-tz.js +212 -212
- package/lib/src/data/links.d.ts +12 -0
- package/lib/src/data/links.js +12 -0
- package/package.json +6 -6
- package/polyfill.iife.js +827 -523
- package/should-polyfill.js +1 -2
- package/src/abstract/BasicFormatMatcher.js +1 -2
- package/src/abstract/BestFitFormatMatcher.js +2 -3
- package/src/abstract/DateTimeStyleFormat.js +1 -2
- package/src/abstract/FormatDateTime.js +1 -2
- package/src/abstract/FormatDateTimePattern.d.ts +1 -1
- package/src/abstract/FormatDateTimePattern.js +5 -6
- package/src/abstract/FormatDateTimeRange.js +1 -2
- package/src/abstract/FormatDateTimeRangeToParts.js +1 -2
- package/src/abstract/FormatDateTimeToParts.js +1 -2
- package/src/abstract/InitializeDateTimeFormat.js +1 -2
- package/src/abstract/PartitionDateTimePattern.js +1 -2
- package/src/abstract/PartitionDateTimeRangePattern.js +1 -2
- package/src/abstract/ToDateTimeOptions.js +1 -2
- package/src/abstract/ToLocalTime.js +1 -2
- package/src/abstract/skeleton.js +4 -5
- package/src/data/all-tz.js +212 -212
- package/src/data/links.d.ts +12 -0
- package/src/data/links.js +12 -0
- package/src/get_internal_slots.js +1 -1
- package/src/packer.js +2 -3
- package/src/to_locale_string.js +3 -4
package/should-polyfill.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.shouldPolyfill =
|
|
3
|
+
exports.shouldPolyfill = shouldPolyfill;
|
|
4
4
|
var intl_localematcher_1 = require("@formatjs/intl-localematcher");
|
|
5
5
|
var supported_locales_generated_1 = require("./supported-locales.generated");
|
|
6
6
|
function supportsDateStyle() {
|
|
@@ -62,4 +62,3 @@ function shouldPolyfill(locale) {
|
|
|
62
62
|
return locale ? (0, intl_localematcher_1.match)([locale], supported_locales_generated_1.supportedLocales, 'en') : undefined;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
exports.shouldPolyfill = shouldPolyfill;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BasicFormatMatcher =
|
|
3
|
+
exports.BasicFormatMatcher = BasicFormatMatcher;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
6
6
|
var utils_1 = require("./utils");
|
|
@@ -107,4 +107,3 @@ function BasicFormatMatcher(options, formats) {
|
|
|
107
107
|
}
|
|
108
108
|
return tslib_1.__assign({}, bestFormat);
|
|
109
109
|
}
|
|
110
|
-
exports.BasicFormatMatcher = BasicFormatMatcher;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.bestFitFormatMatcherScore = bestFitFormatMatcherScore;
|
|
4
|
+
exports.BestFitFormatMatcher = BestFitFormatMatcher;
|
|
4
5
|
var tslib_1 = require("tslib");
|
|
5
6
|
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
6
7
|
var utils_1 = require("./utils");
|
|
@@ -60,7 +61,6 @@ function bestFitFormatMatcherScore(options, format) {
|
|
|
60
61
|
}
|
|
61
62
|
return score;
|
|
62
63
|
}
|
|
63
|
-
exports.bestFitFormatMatcherScore = bestFitFormatMatcherScore;
|
|
64
64
|
/**
|
|
65
65
|
* https://tc39.es/ecma402/#sec-bestfitformatmatcher
|
|
66
66
|
* Just alias to basic for now
|
|
@@ -118,4 +118,3 @@ function BestFitFormatMatcher(options, formats) {
|
|
|
118
118
|
patternFormat.rangePatterns12 = skeletonFormat.rangePatterns12;
|
|
119
119
|
return patternFormat;
|
|
120
120
|
}
|
|
121
|
-
exports.BestFitFormatMatcher = BestFitFormatMatcher;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DateTimeStyleFormat =
|
|
3
|
+
exports.DateTimeStyleFormat = DateTimeStyleFormat;
|
|
4
4
|
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
5
5
|
function DateTimeStyleFormat(dateStyle, timeStyle, dataLocaleData) {
|
|
6
6
|
var dateFormat, timeFormat;
|
|
@@ -51,4 +51,3 @@ function DateTimeStyleFormat(dateStyle, timeStyle, dataLocaleData) {
|
|
|
51
51
|
(0, ecma402_abstract_1.invariant)(dateStyle !== undefined, 'dateStyle should not be undefined');
|
|
52
52
|
return dateFormat;
|
|
53
53
|
}
|
|
54
|
-
exports.DateTimeStyleFormat = DateTimeStyleFormat;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FormatDateTime =
|
|
3
|
+
exports.FormatDateTime = FormatDateTime;
|
|
4
4
|
var PartitionDateTimePattern_1 = require("./PartitionDateTimePattern");
|
|
5
5
|
/**
|
|
6
6
|
* https://tc39.es/ecma402/#sec-formatdatetime
|
|
@@ -16,4 +16,3 @@ function FormatDateTime(dtf, x, implDetails) {
|
|
|
16
16
|
}
|
|
17
17
|
return result;
|
|
18
18
|
}
|
|
19
|
-
exports.FormatDateTime = FormatDateTime;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DateTimeFormat, DateTimeFormatLocaleInternalData, IntlDateTimeFormatInternal, IntlDateTimeFormatPart } from '@formatjs/ecma402-abstract';
|
|
2
2
|
import { ToLocalTimeImplDetails } from './ToLocalTime';
|
|
3
3
|
export interface FormatDateTimePatternImplDetails {
|
|
4
4
|
getInternalSlots(dtf: Intl.DateTimeFormat | DateTimeFormat): IntlDateTimeFormatInternal;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FormatDateTimePattern =
|
|
3
|
+
exports.FormatDateTimePattern = FormatDateTimePattern;
|
|
4
4
|
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
5
|
-
var utils_1 = require("./utils");
|
|
6
5
|
var ToLocalTime_1 = require("./ToLocalTime");
|
|
6
|
+
var utils_1 = require("./utils");
|
|
7
7
|
function pad(n) {
|
|
8
8
|
if (n < 10) {
|
|
9
9
|
return "0".concat(n);
|
|
@@ -48,18 +48,18 @@ function FormatDateTimePattern(dtf, patternParts, x, _a) {
|
|
|
48
48
|
var locale = internalSlots.locale;
|
|
49
49
|
var nfOptions = Object.create(null);
|
|
50
50
|
nfOptions.useGrouping = false;
|
|
51
|
-
var nf =
|
|
51
|
+
var nf = (0, ecma402_abstract_1.createMemoizedNumberFormat)(locale, nfOptions);
|
|
52
52
|
var nf2Options = Object.create(null);
|
|
53
53
|
nf2Options.minimumIntegerDigits = 2;
|
|
54
54
|
nf2Options.useGrouping = false;
|
|
55
|
-
var nf2 =
|
|
55
|
+
var nf2 = (0, ecma402_abstract_1.createMemoizedNumberFormat)(locale, nf2Options);
|
|
56
56
|
var fractionalSecondDigits = internalSlots.fractionalSecondDigits;
|
|
57
57
|
var nf3;
|
|
58
58
|
if (fractionalSecondDigits !== undefined) {
|
|
59
59
|
var nf3Options = Object.create(null);
|
|
60
60
|
nf3Options.minimumIntegerDigits = fractionalSecondDigits;
|
|
61
61
|
nf3Options.useGrouping = false;
|
|
62
|
-
nf3 =
|
|
62
|
+
nf3 = (0, ecma402_abstract_1.createMemoizedNumberFormat)(locale, nf3Options);
|
|
63
63
|
}
|
|
64
64
|
var tm = (0, ToLocalTime_1.ToLocalTime)(x,
|
|
65
65
|
// @ts-ignore
|
|
@@ -187,4 +187,3 @@ function FormatDateTimePattern(dtf, patternParts, x, _a) {
|
|
|
187
187
|
}
|
|
188
188
|
return result;
|
|
189
189
|
}
|
|
190
|
-
exports.FormatDateTimePattern = FormatDateTimePattern;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FormatDateTimeRange =
|
|
3
|
+
exports.FormatDateTimeRange = FormatDateTimeRange;
|
|
4
4
|
var PartitionDateTimeRangePattern_1 = require("./PartitionDateTimeRangePattern");
|
|
5
5
|
function FormatDateTimeRange(dtf, x, y, implDetails) {
|
|
6
6
|
var parts = (0, PartitionDateTimeRangePattern_1.PartitionDateTimeRangePattern)(dtf, x, y, implDetails);
|
|
@@ -11,4 +11,3 @@ function FormatDateTimeRange(dtf, x, y, implDetails) {
|
|
|
11
11
|
}
|
|
12
12
|
return result;
|
|
13
13
|
}
|
|
14
|
-
exports.FormatDateTimeRange = FormatDateTimeRange;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FormatDateTimeRangeToParts =
|
|
3
|
+
exports.FormatDateTimeRangeToParts = FormatDateTimeRangeToParts;
|
|
4
4
|
var PartitionDateTimeRangePattern_1 = require("./PartitionDateTimeRangePattern");
|
|
5
5
|
function FormatDateTimeRangeToParts(dtf, x, y, implDetails) {
|
|
6
6
|
var parts = (0, PartitionDateTimeRangePattern_1.PartitionDateTimeRangePattern)(dtf, x, y, implDetails);
|
|
@@ -15,4 +15,3 @@ function FormatDateTimeRangeToParts(dtf, x, y, implDetails) {
|
|
|
15
15
|
}
|
|
16
16
|
return result;
|
|
17
17
|
}
|
|
18
|
-
exports.FormatDateTimeRangeToParts = FormatDateTimeRangeToParts;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FormatDateTimeToParts =
|
|
3
|
+
exports.FormatDateTimeToParts = FormatDateTimeToParts;
|
|
4
4
|
var PartitionDateTimePattern_1 = require("./PartitionDateTimePattern");
|
|
5
5
|
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
6
6
|
/**
|
|
@@ -22,4 +22,3 @@ function FormatDateTimeToParts(dtf, x, implDetails) {
|
|
|
22
22
|
}
|
|
23
23
|
return result;
|
|
24
24
|
}
|
|
25
|
-
exports.FormatDateTimeToParts = FormatDateTimeToParts;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InitializeDateTimeFormat =
|
|
3
|
+
exports.InitializeDateTimeFormat = InitializeDateTimeFormat;
|
|
4
4
|
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
5
5
|
var intl_localematcher_1 = require("@formatjs/intl-localematcher");
|
|
6
6
|
var BasicFormatMatcher_1 = require("./BasicFormatMatcher");
|
|
@@ -191,4 +191,3 @@ function InitializeDateTimeFormat(dtf, locales, opts, _a) {
|
|
|
191
191
|
internalSlots.rangePatterns = rangePatterns;
|
|
192
192
|
return dtf; // TODO: remove this when https://github.com/microsoft/TypeScript/pull/50402 is merged
|
|
193
193
|
}
|
|
194
|
-
exports.InitializeDateTimeFormat = InitializeDateTimeFormat;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PartitionDateTimePattern =
|
|
3
|
+
exports.PartitionDateTimePattern = PartitionDateTimePattern;
|
|
4
4
|
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
5
5
|
var FormatDateTimePattern_1 = require("./FormatDateTimePattern");
|
|
6
6
|
/**
|
|
@@ -20,4 +20,3 @@ function PartitionDateTimePattern(dtf, x, implDetails) {
|
|
|
20
20
|
var pattern = internalSlots.pattern;
|
|
21
21
|
return (0, FormatDateTimePattern_1.FormatDateTimePattern)(dtf, (0, ecma402_abstract_1.PartitionPattern)(pattern), x, implDetails);
|
|
22
22
|
}
|
|
23
|
-
exports.PartitionDateTimePattern = PartitionDateTimePattern;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PartitionDateTimeRangePattern =
|
|
3
|
+
exports.PartitionDateTimeRangePattern = PartitionDateTimeRangePattern;
|
|
4
4
|
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
5
5
|
var ToLocalTime_1 = require("./ToLocalTime");
|
|
6
6
|
var FormatDateTimePattern_1 = require("./FormatDateTimePattern");
|
|
@@ -120,4 +120,3 @@ function PartitionDateTimeRangePattern(dtf, x, y, implDetails) {
|
|
|
120
120
|
}
|
|
121
121
|
return result;
|
|
122
122
|
}
|
|
123
|
-
exports.PartitionDateTimeRangePattern = PartitionDateTimeRangePattern;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ToDateTimeOptions =
|
|
3
|
+
exports.ToDateTimeOptions = ToDateTimeOptions;
|
|
4
4
|
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
5
5
|
/**
|
|
6
6
|
* https://tc39.es/ecma402/#sec-todatetimeoptions
|
|
@@ -64,4 +64,3 @@ function ToDateTimeOptions(options, required, defaults) {
|
|
|
64
64
|
}
|
|
65
65
|
return options;
|
|
66
66
|
}
|
|
67
|
-
exports.ToDateTimeOptions = ToDateTimeOptions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ToLocalTime =
|
|
3
|
+
exports.ToLocalTime = ToLocalTime;
|
|
4
4
|
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
5
5
|
function getApplicableZoneData(t, timeZone, tzData) {
|
|
6
6
|
var _a;
|
|
@@ -51,4 +51,3 @@ function ToLocalTime(t, calendar, timeZone, _a) {
|
|
|
51
51
|
timeZoneOffset: timeZoneOffset,
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
exports.ToLocalTime = ToLocalTime;
|
package/src/abstract/skeleton.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.processDateTimePattern = processDateTimePattern;
|
|
4
|
+
exports.parseDateTimeSkeleton = parseDateTimeSkeleton;
|
|
5
|
+
exports.splitFallbackRangePattern = splitFallbackRangePattern;
|
|
6
|
+
exports.splitRangePattern = splitRangePattern;
|
|
4
7
|
var tslib_1 = require("tslib");
|
|
5
8
|
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
6
9
|
/**
|
|
@@ -195,7 +198,6 @@ function processDateTimePattern(pattern, result) {
|
|
|
195
198
|
pattern12,
|
|
196
199
|
];
|
|
197
200
|
}
|
|
198
|
-
exports.processDateTimePattern = processDateTimePattern;
|
|
199
201
|
/**
|
|
200
202
|
* Parse Date time skeleton into Intl.DateTimeFormatOptions
|
|
201
203
|
* Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
@@ -240,7 +242,6 @@ function parseDateTimeSkeleton(skeleton, rawPattern, rangePatterns, intervalForm
|
|
|
240
242
|
result.pattern12 = pattern12;
|
|
241
243
|
return result;
|
|
242
244
|
}
|
|
243
|
-
exports.parseDateTimeSkeleton = parseDateTimeSkeleton;
|
|
244
245
|
function splitFallbackRangePattern(pattern) {
|
|
245
246
|
var parts = pattern.split(/(\{[0|1]\})/g).filter(Boolean);
|
|
246
247
|
return parts.map(function (pattern) {
|
|
@@ -263,7 +264,6 @@ function splitFallbackRangePattern(pattern) {
|
|
|
263
264
|
}
|
|
264
265
|
});
|
|
265
266
|
}
|
|
266
|
-
exports.splitFallbackRangePattern = splitFallbackRangePattern;
|
|
267
267
|
function splitRangePattern(pattern) {
|
|
268
268
|
var PART_REGEX = /\{(.*?)\}/g;
|
|
269
269
|
// Map of part and index within the string
|
|
@@ -298,4 +298,3 @@ function splitRangePattern(pattern) {
|
|
|
298
298
|
},
|
|
299
299
|
];
|
|
300
300
|
}
|
|
301
|
-
exports.splitRangePattern = splitRangePattern;
|