Socket
Socket
Sign inDemoInstall

@formatjs/intl-datetimeformat

Package Overview
Dependencies
3
Maintainers
3
Versions
122
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.11.3 to 6.12.0

5

lib/index.js

@@ -1,4 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
tslib_1.__exportStar(require("./src/core"), exports);
export * from './src/core';

22

lib/polyfill-force.js

@@ -1,21 +0,19 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var _1 = require("./");
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
var to_locale_string_1 = require("./src/to_locale_string");
(0, ecma402_abstract_1.defineProperty)(Intl, 'DateTimeFormat', { value: _1.DateTimeFormat });
(0, ecma402_abstract_1.defineProperty)(Date.prototype, 'toLocaleString', {
import { DateTimeFormat } from './';
import { defineProperty } from '@formatjs/ecma402-abstract';
import { toLocaleString as _toLocaleString, toLocaleDateString as _toLocaleDateString, toLocaleTimeString as _toLocaleTimeString, } from './src/to_locale_string';
defineProperty(Intl, 'DateTimeFormat', { value: DateTimeFormat });
defineProperty(Date.prototype, 'toLocaleString', {
value: function toLocaleString(locales, options) {
return (0, to_locale_string_1.toLocaleString)(this, locales, options);
return _toLocaleString(this, locales, options);
},
});
(0, ecma402_abstract_1.defineProperty)(Date.prototype, 'toLocaleDateString', {
defineProperty(Date.prototype, 'toLocaleDateString', {
value: function toLocaleDateString(locales, options) {
return (0, to_locale_string_1.toLocaleDateString)(this, locales, options);
return _toLocaleDateString(this, locales, options);
},
});
(0, ecma402_abstract_1.defineProperty)(Date.prototype, 'toLocaleTimeString', {
defineProperty(Date.prototype, 'toLocaleTimeString', {
value: function toLocaleTimeString(locales, options) {
return (0, to_locale_string_1.toLocaleTimeString)(this, locales, options);
return _toLocaleTimeString(this, locales, options);
},
});

@@ -1,13 +0,11 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var _1 = require("./");
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
var should_polyfill_1 = require("./should-polyfill");
var to_locale_string_1 = require("./src/to_locale_string");
if ((0, should_polyfill_1.shouldPolyfill)()) {
(0, ecma402_abstract_1.defineProperty)(Intl, 'DateTimeFormat', { value: _1.DateTimeFormat });
(0, ecma402_abstract_1.defineProperty)(Date.prototype, 'toLocaleString', {
import { DateTimeFormat } from './';
import { defineProperty } from '@formatjs/ecma402-abstract';
import { shouldPolyfill } from './should-polyfill';
import { toLocaleString as _toLocaleString, toLocaleDateString as _toLocaleDateString, toLocaleTimeString as _toLocaleTimeString, } from './src/to_locale_string';
if (shouldPolyfill()) {
defineProperty(Intl, 'DateTimeFormat', { value: DateTimeFormat });
defineProperty(Date.prototype, 'toLocaleString', {
value: function toLocaleString(locales, options) {
try {
return (0, to_locale_string_1.toLocaleString)(this, locales, options);
return _toLocaleString(this, locales, options);
}

@@ -19,6 +17,6 @@ catch (error) {

});
(0, ecma402_abstract_1.defineProperty)(Date.prototype, 'toLocaleDateString', {
defineProperty(Date.prototype, 'toLocaleDateString', {
value: function toLocaleDateString(locales, options) {
try {
return (0, to_locale_string_1.toLocaleDateString)(this, locales, options);
return _toLocaleDateString(this, locales, options);
}

@@ -30,6 +28,6 @@ catch (error) {

});
(0, ecma402_abstract_1.defineProperty)(Date.prototype, 'toLocaleTimeString', {
defineProperty(Date.prototype, 'toLocaleTimeString', {
value: function toLocaleTimeString(locales, options) {
try {
return (0, to_locale_string_1.toLocaleTimeString)(this, locales, options);
return _toLocaleTimeString(this, locales, options);
}

@@ -36,0 +34,0 @@ catch (error) {

@@ -1,6 +0,3 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.shouldPolyfill = void 0;
var intl_localematcher_1 = require("@formatjs/intl-localematcher");
var supported_locales_generated_1 = require("./supported-locales.generated");
import { match } from '@formatjs/intl-localematcher';
import { supportedLocales } from './supported-locales.generated';
function supportsDateStyle() {

@@ -53,3 +50,3 @@ try {

}
function shouldPolyfill(locale) {
export function shouldPolyfill(locale) {
if (locale === void 0) { locale = 'en'; }

@@ -63,5 +60,4 @@ if (!('DateTimeFormat' in Intl) ||

!supportedLocalesOf(locale)) {
return locale ? (0, intl_localematcher_1.match)([locale], supported_locales_generated_1.supportedLocales, 'en') : undefined;
return locale ? match([locale], supportedLocales, 'en') : undefined;
}
}
exports.shouldPolyfill = shouldPolyfill;

@@ -1,7 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BasicFormatMatcher = void 0;
var tslib_1 = require("tslib");
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
var utils_1 = require("./utils");
import { __assign } from "tslib";
import { invariant } from '@formatjs/ecma402-abstract';
import { DATE_TIME_PROPS, additionPenalty, removalPenalty, longMorePenalty, shortMorePenalty, shortLessPenalty, longLessPenalty, offsetPenalty, } from './utils';
/**

@@ -12,10 +9,10 @@ * https://tc39.es/ecma402/#sec-basicformatmatcher

*/
function BasicFormatMatcher(options, formats) {
export function BasicFormatMatcher(options, formats) {
var bestScore = -Infinity;
var bestFormat = formats[0];
(0, ecma402_abstract_1.invariant)(Array.isArray(formats), 'formats should be a list of things');
invariant(Array.isArray(formats), 'formats should be a list of things');
for (var _i = 0, formats_1 = formats; _i < formats_1.length; _i++) {
var format = formats_1[_i];
var score = 0;
for (var _a = 0, DATE_TIME_PROPS_1 = utils_1.DATE_TIME_PROPS; _a < DATE_TIME_PROPS_1.length; _a++) {
for (var _a = 0, DATE_TIME_PROPS_1 = DATE_TIME_PROPS; _a < DATE_TIME_PROPS_1.length; _a++) {
var prop = DATE_TIME_PROPS_1[_a];

@@ -25,6 +22,6 @@ var optionsProp = options[prop];

if (optionsProp === undefined && formatProp !== undefined) {
score -= utils_1.additionPenalty;
score -= additionPenalty;
}
else if (optionsProp !== undefined && formatProp === undefined) {
score -= utils_1.removalPenalty;
score -= removalPenalty;
}

@@ -34,16 +31,16 @@ else if (prop === 'timeZoneName') {

if (formatProp === 'shortOffset') {
score -= utils_1.offsetPenalty;
score -= offsetPenalty;
}
else if (formatProp === 'longOffset') {
score -= utils_1.offsetPenalty + utils_1.shortMorePenalty;
score -= offsetPenalty + shortMorePenalty;
}
else if (optionsProp === 'short' && formatProp === 'long') {
score -= utils_1.shortMorePenalty;
score -= shortMorePenalty;
}
else if (optionsProp === 'shortGeneric' &&
formatProp === 'longGeneric') {
score -= utils_1.shortMorePenalty;
score -= shortMorePenalty;
}
else if (optionsProp !== formatProp) {
score -= utils_1.removalPenalty;
score -= removalPenalty;
}

@@ -53,20 +50,20 @@ }

formatProp === 'longOffset') {
score -= utils_1.shortMorePenalty;
score -= shortMorePenalty;
}
else if (optionsProp === 'long' || optionsProp === 'longGeneric') {
if (formatProp === 'longOffset') {
score -= utils_1.offsetPenalty;
score -= offsetPenalty;
}
else if (formatProp === 'shortOffset') {
score -= utils_1.offsetPenalty + utils_1.longLessPenalty;
score -= offsetPenalty + longLessPenalty;
}
else if (optionsProp === 'long' && formatProp === 'short') {
score -= utils_1.longLessPenalty;
score -= longLessPenalty;
}
else if (optionsProp === 'longGeneric' &&
formatProp === 'shortGeneric') {
score -= utils_1.longLessPenalty;
score -= longLessPenalty;
}
else if (optionsProp !== formatProp) {
score -= utils_1.removalPenalty;
score -= removalPenalty;
}

@@ -76,6 +73,6 @@ }

formatProp === 'shortOffset') {
score -= utils_1.longLessPenalty;
score -= longLessPenalty;
}
else if (optionsProp !== formatProp) {
score -= utils_1.removalPenalty;
score -= removalPenalty;
}

@@ -95,12 +92,12 @@ }

if (delta === 2) {
score -= utils_1.longMorePenalty;
score -= longMorePenalty;
}
else if (delta === 1) {
score -= utils_1.shortMorePenalty;
score -= shortMorePenalty;
}
else if (delta === -1) {
score -= utils_1.shortLessPenalty;
score -= shortLessPenalty;
}
else if (delta === -2) {
score -= utils_1.longLessPenalty;
score -= longLessPenalty;
}

@@ -114,4 +111,3 @@ }

}
return tslib_1.__assign({}, bestFormat);
return __assign({}, bestFormat);
}
exports.BasicFormatMatcher = BasicFormatMatcher;

@@ -1,8 +0,5 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BestFitFormatMatcher = exports.bestFitFormatMatcherScore = void 0;
var tslib_1 = require("tslib");
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
var utils_1 = require("./utils");
var skeleton_1 = require("./skeleton");
import { __assign } from "tslib";
import { invariant } from '@formatjs/ecma402-abstract';
import { DATE_TIME_PROPS, removalPenalty, additionPenalty, differentNumericTypePenalty, longMorePenalty, shortMorePenalty, shortLessPenalty, longLessPenalty, } from './utils';
import { processDateTimePattern } from './skeleton';
function isNumericType(t) {

@@ -17,11 +14,11 @@ return t === 'numeric' || t === '2-digit';

*/
function bestFitFormatMatcherScore(options, format) {
export function bestFitFormatMatcherScore(options, format) {
var score = 0;
if (options.hour12 && !format.hour12) {
score -= utils_1.removalPenalty;
score -= removalPenalty;
}
else if (!options.hour12 && format.hour12) {
score -= utils_1.additionPenalty;
score -= additionPenalty;
}
for (var _i = 0, DATE_TIME_PROPS_1 = utils_1.DATE_TIME_PROPS; _i < DATE_TIME_PROPS_1.length; _i++) {
for (var _i = 0, DATE_TIME_PROPS_1 = DATE_TIME_PROPS; _i < DATE_TIME_PROPS_1.length; _i++) {
var prop = DATE_TIME_PROPS_1[_i];

@@ -31,6 +28,6 @@ var optionsProp = options[prop];

if (optionsProp === undefined && formatProp !== undefined) {
score -= utils_1.additionPenalty;
score -= additionPenalty;
}
else if (optionsProp !== undefined && formatProp === undefined) {
score -= utils_1.removalPenalty;
score -= removalPenalty;
}

@@ -41,3 +38,3 @@ else if (optionsProp !== formatProp) {

isNumericType(formatProp)) {
score -= utils_1.differentNumericTypePenalty;
score -= differentNumericTypePenalty;
}

@@ -50,12 +47,12 @@ else {

if (delta === 2) {
score -= utils_1.longMorePenalty;
score -= longMorePenalty;
}
else if (delta === 1) {
score -= utils_1.shortMorePenalty;
score -= shortMorePenalty;
}
else if (delta === -1) {
score -= utils_1.shortLessPenalty;
score -= shortLessPenalty;
}
else if (delta === -2) {
score -= utils_1.longLessPenalty;
score -= longLessPenalty;
}

@@ -67,3 +64,2 @@ }

}
exports.bestFitFormatMatcherScore = bestFitFormatMatcherScore;
/**

@@ -76,6 +72,6 @@ * https://tc39.es/ecma402/#sec-bestfitformatmatcher

*/
function BestFitFormatMatcher(options, formats) {
export function BestFitFormatMatcher(options, formats) {
var bestScore = -Infinity;
var bestFormat = formats[0];
(0, ecma402_abstract_1.invariant)(Array.isArray(formats), 'formats should be a list of things');
invariant(Array.isArray(formats), 'formats should be a list of things');
for (var _i = 0, formats_1 = formats; _i < formats_1.length; _i++) {

@@ -89,5 +85,5 @@ var format = formats_1[_i];

}
var skeletonFormat = tslib_1.__assign({}, bestFormat);
var skeletonFormat = __assign({}, bestFormat);
var patternFormat = { rawPattern: bestFormat.rawPattern };
(0, skeleton_1.processDateTimePattern)(bestFormat.rawPattern, patternFormat);
processDateTimePattern(bestFormat.rawPattern, patternFormat);
// Kinda following https://github.com/unicode-org/icu/blob/dd50e38f459d84e9bf1b0c618be8483d318458ad/icu4j/main/classes/core/src/com/ibm/icu/text/DateTimePatternGenerator.java

@@ -128,2 +124,1 @@ // Method adjustFieldTypes

}
exports.BestFitFormatMatcher = BestFitFormatMatcher;

@@ -1,9 +0,6 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DateTimeStyleFormat = void 0;
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
function DateTimeStyleFormat(dateStyle, timeStyle, dataLocaleData) {
import { invariant, } from '@formatjs/ecma402-abstract';
export function DateTimeStyleFormat(dateStyle, timeStyle, dataLocaleData) {
var dateFormat, timeFormat;
if (timeStyle !== undefined) {
(0, ecma402_abstract_1.invariant)(timeStyle === 'full' ||
invariant(timeStyle === 'full' ||
timeStyle === 'long' ||

@@ -15,3 +12,3 @@ timeStyle === 'medium' ||

if (dateStyle !== undefined) {
(0, ecma402_abstract_1.invariant)(dateStyle === 'full' ||
invariant(dateStyle === 'full' ||
dateStyle === 'long' ||

@@ -52,5 +49,4 @@ dateStyle === 'medium' ||

}
(0, ecma402_abstract_1.invariant)(dateStyle !== undefined, 'dateStyle should not be undefined');
invariant(dateStyle !== undefined, 'dateStyle should not be undefined');
return dateFormat;
}
exports.DateTimeStyleFormat = DateTimeStyleFormat;

@@ -1,5 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FormatDateTime = void 0;
var PartitionDateTimePattern_1 = require("./PartitionDateTimePattern");
import { PartitionDateTimePattern } from './PartitionDateTimePattern';
/**

@@ -10,4 +7,4 @@ * https://tc39.es/ecma402/#sec-formatdatetime

*/
function FormatDateTime(dtf, x, implDetails) {
var parts = (0, PartitionDateTimePattern_1.PartitionDateTimePattern)(dtf, x, implDetails);
export function FormatDateTime(dtf, x, implDetails) {
var parts = PartitionDateTimePattern(dtf, x, implDetails);
var result = '';

@@ -20,2 +17,1 @@ for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) {

}
exports.FormatDateTime = FormatDateTime;

@@ -1,7 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FormatDateTimePattern = void 0;
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
var utils_1 = require("./utils");
var ToLocalTime_1 = require("./ToLocalTime");
import { TimeClip, } from '@formatjs/ecma402-abstract';
import { DATE_TIME_PROPS } from './utils';
import { ToLocalTime } from './ToLocalTime';
function pad(n) {

@@ -40,5 +37,5 @@ if (n < 10) {

*/
function FormatDateTimePattern(dtf, patternParts, x, _a) {
export function FormatDateTimePattern(dtf, patternParts, x, _a) {
var getInternalSlots = _a.getInternalSlots, localeData = _a.localeData, getDefaultTimeZone = _a.getDefaultTimeZone, tzData = _a.tzData;
x = (0, ecma402_abstract_1.TimeClip)(x);
x = TimeClip(x);
/** IMPL START */

@@ -65,3 +62,3 @@ var internalSlots = getInternalSlots(dtf);

}
var tm = (0, ToLocalTime_1.ToLocalTime)(x,
var tm = ToLocalTime(x,
// @ts-ignore

@@ -107,3 +104,3 @@ internalSlots.calendar, internalSlots.timeZone, { tzData: tzData });

}
else if (utils_1.DATE_TIME_PROPS.indexOf(p) > -1) {
else if (DATE_TIME_PROPS.indexOf(p) > -1) {
var fv = '';

@@ -193,2 +190,1 @@ var f = internalSlots[p];

}
exports.FormatDateTimePattern = FormatDateTimePattern;

@@ -1,7 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FormatDateTimeRange = void 0;
var PartitionDateTimeRangePattern_1 = require("./PartitionDateTimeRangePattern");
function FormatDateTimeRange(dtf, x, y, implDetails) {
var parts = (0, PartitionDateTimeRangePattern_1.PartitionDateTimeRangePattern)(dtf, x, y, implDetails);
import { PartitionDateTimeRangePattern } from './PartitionDateTimeRangePattern';
export function FormatDateTimeRange(dtf, x, y, implDetails) {
var parts = PartitionDateTimeRangePattern(dtf, x, y, implDetails);
var result = '';

@@ -14,2 +11,1 @@ for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) {

}
exports.FormatDateTimeRange = FormatDateTimeRange;

@@ -1,7 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FormatDateTimeRangeToParts = void 0;
var PartitionDateTimeRangePattern_1 = require("./PartitionDateTimeRangePattern");
function FormatDateTimeRangeToParts(dtf, x, y, implDetails) {
var parts = (0, PartitionDateTimeRangePattern_1.PartitionDateTimeRangePattern)(dtf, x, y, implDetails);
import { PartitionDateTimeRangePattern } from './PartitionDateTimeRangePattern';
export function FormatDateTimeRangeToParts(dtf, x, y, implDetails) {
var parts = PartitionDateTimeRangePattern(dtf, x, y, implDetails);
var result = new Array(0);

@@ -18,2 +15,1 @@ for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) {

}
exports.FormatDateTimeRangeToParts = FormatDateTimeRangeToParts;

@@ -1,6 +0,3 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FormatDateTimeToParts = void 0;
var PartitionDateTimePattern_1 = require("./PartitionDateTimePattern");
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
import { PartitionDateTimePattern } from './PartitionDateTimePattern';
import { ArrayCreate } from '@formatjs/ecma402-abstract';
/**

@@ -13,5 +10,5 @@ * https://tc39.es/ecma402/#sec-formatdatetimetoparts

*/
function FormatDateTimeToParts(dtf, x, implDetails) {
var parts = (0, PartitionDateTimePattern_1.PartitionDateTimePattern)(dtf, x, implDetails);
var result = (0, ecma402_abstract_1.ArrayCreate)(0);
export function FormatDateTimeToParts(dtf, x, implDetails) {
var parts = PartitionDateTimePattern(dtf, x, implDetails);
var result = ArrayCreate(0);
for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) {

@@ -26,2 +23,1 @@ var part = parts_1[_i];

}
exports.FormatDateTimeToParts = FormatDateTimeToParts;

@@ -1,2 +0,2 @@

import { IntlDateTimeFormatInternal, DateTimeFormatLocaleInternalData, DateTimeFormat as DateTimeFormat } from '@formatjs/ecma402-abstract';
import { DateTimeFormat, DateTimeFormatLocaleInternalData, IntlDateTimeFormatInternal } from '@formatjs/ecma402-abstract';
/**

@@ -3,0 +3,0 @@ * https://tc39.es/ecma402/#sec-initializedatetimeformat

@@ -1,11 +0,8 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InitializeDateTimeFormat = void 0;
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
var BasicFormatMatcher_1 = require("./BasicFormatMatcher");
var BestFitFormatMatcher_1 = require("./BestFitFormatMatcher");
var utils_1 = require("./utils");
var DateTimeStyleFormat_1 = require("./DateTimeStyleFormat");
var ToDateTimeOptions_1 = require("./ToDateTimeOptions");
var intl_localematcher_1 = require("@formatjs/intl-localematcher");
import { CanonicalizeLocaleList, CanonicalizeTimeZoneName, GetNumberOption, GetOption, IsValidTimeZoneName, invariant, } from '@formatjs/ecma402-abstract';
import { ResolveLocale } from '@formatjs/intl-localematcher';
import { BasicFormatMatcher } from './BasicFormatMatcher';
import { BestFitFormatMatcher } from './BestFitFormatMatcher';
import { DateTimeStyleFormat } from './DateTimeStyleFormat';
import { ToDateTimeOptions } from './ToDateTimeOptions';
import { DATE_TIME_PROPS } from './utils';
function isTimeRelated(opt) {

@@ -35,3 +32,3 @@ for (var _i = 0, _a = ['hour', 'minute', 'second']; _i < _a.length; _i++) {

else {
(0, ecma402_abstract_1.invariant)(!hour12, 'hour12 must not be set');
invariant(!hour12, 'hour12 must not be set');
if (hcDefault === 'h11' || hcDefault === 'h23') {

@@ -54,11 +51,11 @@ hc = 'h23';

*/
function InitializeDateTimeFormat(dtf, locales, opts, _a) {
export function InitializeDateTimeFormat(dtf, locales, opts, _a) {
var getInternalSlots = _a.getInternalSlots, availableLocales = _a.availableLocales, localeData = _a.localeData, getDefaultLocale = _a.getDefaultLocale, getDefaultTimeZone = _a.getDefaultTimeZone, relevantExtensionKeys = _a.relevantExtensionKeys, tzData = _a.tzData, uppercaseLinks = _a.uppercaseLinks;
// @ts-ignore
var requestedLocales = (0, ecma402_abstract_1.CanonicalizeLocaleList)(locales);
var options = (0, ToDateTimeOptions_1.ToDateTimeOptions)(opts, 'any', 'date');
var requestedLocales = CanonicalizeLocaleList(locales);
var options = ToDateTimeOptions(opts, 'any', 'date');
var opt = Object.create(null);
var matcher = (0, ecma402_abstract_1.GetOption)(options, 'localeMatcher', 'string', ['lookup', 'best fit'], 'best fit');
var matcher = GetOption(options, 'localeMatcher', 'string', ['lookup', 'best fit'], 'best fit');
opt.localeMatcher = matcher;
var calendar = (0, ecma402_abstract_1.GetOption)(options, 'calendar', 'string', undefined, undefined);
var calendar = GetOption(options, 'calendar', 'string', undefined, undefined);
if (calendar !== undefined && !TYPE_REGEX.test(calendar)) {

@@ -69,3 +66,3 @@ throw new RangeError('Malformed calendar');

opt.ca = calendar;
var numberingSystem = (0, ecma402_abstract_1.GetOption)(options, 'numberingSystem', 'string', undefined, undefined);
var numberingSystem = GetOption(options, 'numberingSystem', 'string', undefined, undefined);
if (numberingSystem !== undefined && !TYPE_REGEX.test(numberingSystem)) {

@@ -75,4 +72,4 @@ throw new RangeError('Malformed numbering system');

opt.nu = numberingSystem;
var hour12 = (0, ecma402_abstract_1.GetOption)(options, 'hour12', 'boolean', undefined, undefined);
var hourCycle = (0, ecma402_abstract_1.GetOption)(options, 'hourCycle', 'string', ['h11', 'h12', 'h23', 'h24'], undefined);
var hour12 = GetOption(options, 'hour12', 'boolean', undefined, undefined);
var hourCycle = GetOption(options, 'hourCycle', 'string', ['h11', 'h12', 'h23', 'h24'], undefined);
if (hour12 !== undefined) {

@@ -83,3 +80,3 @@ // @ts-ignore

opt.hc = hourCycle;
var r = (0, intl_localematcher_1.ResolveLocale)(availableLocales, requestedLocales, opt, relevantExtensionKeys, localeData, getDefaultLocale);
var r = ResolveLocale(availableLocales, requestedLocales, opt, relevantExtensionKeys, localeData, getDefaultLocale);
internalSlots.locale = r.locale;

@@ -95,6 +92,6 @@ calendar = r.ca;

timeZone = String(timeZone);
if (!(0, ecma402_abstract_1.IsValidTimeZoneName)(timeZone, { tzData: tzData, uppercaseLinks: uppercaseLinks })) {
if (!IsValidTimeZoneName(timeZone, { tzData: tzData, uppercaseLinks: uppercaseLinks })) {
throw new RangeError('Invalid timeZoneName');
}
timeZone = (0, ecma402_abstract_1.CanonicalizeTimeZoneName)(timeZone, { tzData: tzData, uppercaseLinks: uppercaseLinks });
timeZone = CanonicalizeTimeZoneName(timeZone, { tzData: tzData, uppercaseLinks: uppercaseLinks });
}

@@ -106,11 +103,11 @@ else {

opt = Object.create(null);
opt.weekday = (0, ecma402_abstract_1.GetOption)(options, 'weekday', 'string', ['narrow', 'short', 'long'], undefined);
opt.era = (0, ecma402_abstract_1.GetOption)(options, 'era', 'string', ['narrow', 'short', 'long'], undefined);
opt.year = (0, ecma402_abstract_1.GetOption)(options, 'year', 'string', ['2-digit', 'numeric'], undefined);
opt.month = (0, ecma402_abstract_1.GetOption)(options, 'month', 'string', ['2-digit', 'numeric', 'narrow', 'short', 'long'], undefined);
opt.day = (0, ecma402_abstract_1.GetOption)(options, 'day', 'string', ['2-digit', 'numeric'], undefined);
opt.hour = (0, ecma402_abstract_1.GetOption)(options, 'hour', 'string', ['2-digit', 'numeric'], undefined);
opt.minute = (0, ecma402_abstract_1.GetOption)(options, 'minute', 'string', ['2-digit', 'numeric'], undefined);
opt.second = (0, ecma402_abstract_1.GetOption)(options, 'second', 'string', ['2-digit', 'numeric'], undefined);
opt.timeZoneName = (0, ecma402_abstract_1.GetOption)(options, 'timeZoneName', 'string', [
opt.weekday = GetOption(options, 'weekday', 'string', ['narrow', 'short', 'long'], undefined);
opt.era = GetOption(options, 'era', 'string', ['narrow', 'short', 'long'], undefined);
opt.year = GetOption(options, 'year', 'string', ['2-digit', 'numeric'], undefined);
opt.month = GetOption(options, 'month', 'string', ['2-digit', 'numeric', 'narrow', 'short', 'long'], undefined);
opt.day = GetOption(options, 'day', 'string', ['2-digit', 'numeric'], undefined);
opt.hour = GetOption(options, 'hour', 'string', ['2-digit', 'numeric'], undefined);
opt.minute = GetOption(options, 'minute', 'string', ['2-digit', 'numeric'], undefined);
opt.second = GetOption(options, 'second', 'string', ['2-digit', 'numeric'], undefined);
opt.timeZoneName = GetOption(options, 'timeZoneName', 'string', [
'long',

@@ -123,7 +120,5 @@ 'short',

], undefined);
opt.fractionalSecondDigits = (0, ecma402_abstract_1.GetNumberOption)(options, 'fractionalSecondDigits', 1, 3,
// @ts-expect-error
undefined);
opt.fractionalSecondDigits = GetNumberOption(options, 'fractionalSecondDigits', 1, 3, undefined);
var dataLocaleData = localeData[dataLocale];
(0, ecma402_abstract_1.invariant)(!!dataLocaleData, "Missing locale data for ".concat(dataLocale));
invariant(!!dataLocaleData, "Missing locale data for ".concat(dataLocale));
var formats = dataLocaleData.formats[calendar];

@@ -134,6 +129,6 @@ // UNSPECCED: IMPLEMENTATION DETAILS

}
var formatMatcher = (0, ecma402_abstract_1.GetOption)(options, 'formatMatcher', 'string', ['basic', 'best fit'], 'best fit');
var dateStyle = (0, ecma402_abstract_1.GetOption)(options, 'dateStyle', 'string', ['full', 'long', 'medium', 'short'], undefined);
var formatMatcher = GetOption(options, 'formatMatcher', 'string', ['basic', 'best fit'], 'best fit');
var dateStyle = GetOption(options, 'dateStyle', 'string', ['full', 'long', 'medium', 'short'], undefined);
internalSlots.dateStyle = dateStyle;
var timeStyle = (0, ecma402_abstract_1.GetOption)(options, 'timeStyle', 'string', ['full', 'long', 'medium', 'short'], undefined);
var timeStyle = GetOption(options, 'timeStyle', 'string', ['full', 'long', 'medium', 'short'], undefined);
internalSlots.timeStyle = timeStyle;

@@ -143,3 +138,3 @@ var bestFormat;

if (formatMatcher === 'basic') {
bestFormat = (0, BasicFormatMatcher_1.BasicFormatMatcher)(opt, formats);
bestFormat = BasicFormatMatcher(opt, formats);
}

@@ -153,7 +148,7 @@ else {

// IMPL DETAILS END
bestFormat = (0, BestFitFormatMatcher_1.BestFitFormatMatcher)(opt, formats);
bestFormat = BestFitFormatMatcher(opt, formats);
}
}
else {
for (var _i = 0, DATE_TIME_PROPS_1 = utils_1.DATE_TIME_PROPS; _i < DATE_TIME_PROPS_1.length; _i++) {
for (var _i = 0, DATE_TIME_PROPS_1 = DATE_TIME_PROPS; _i < DATE_TIME_PROPS_1.length; _i++) {
var prop = DATE_TIME_PROPS_1[_i];

@@ -165,3 +160,3 @@ var p = opt[prop];

}
bestFormat = (0, DateTimeStyleFormat_1.DateTimeStyleFormat)(dateStyle, timeStyle, dataLocaleData);
bestFormat = DateTimeStyleFormat(dateStyle, timeStyle, dataLocaleData);
}

@@ -202,2 +197,1 @@ // IMPL DETAIL START

}
exports.InitializeDateTimeFormat = InitializeDateTimeFormat;

@@ -1,6 +0,3 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PartitionDateTimePattern = void 0;
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
var FormatDateTimePattern_1 = require("./FormatDateTimePattern");
import { PartitionPattern, TimeClip, } from '@formatjs/ecma402-abstract';
import { FormatDateTimePattern, } from './FormatDateTimePattern';
/**

@@ -11,4 +8,4 @@ * https://tc39.es/ecma402/#sec-partitiondatetimepattern

*/
function PartitionDateTimePattern(dtf, x, implDetails) {
x = (0, ecma402_abstract_1.TimeClip)(x);
export function PartitionDateTimePattern(dtf, x, implDetails) {
x = TimeClip(x);
if (isNaN(x)) {

@@ -22,4 +19,3 @@ throw new RangeError('invalid time');

var pattern = internalSlots.pattern;
return (0, FormatDateTimePattern_1.FormatDateTimePattern)(dtf, (0, ecma402_abstract_1.PartitionPattern)(pattern), x, implDetails);
return FormatDateTimePattern(dtf, PartitionPattern(pattern), x, implDetails);
}
exports.PartitionDateTimePattern = PartitionDateTimePattern;

@@ -1,7 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PartitionDateTimeRangePattern = void 0;
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
var ToLocalTime_1 = require("./ToLocalTime");
var FormatDateTimePattern_1 = require("./FormatDateTimePattern");
import { RangePatternType, PartitionPattern, SameValue, TimeClip, } from '@formatjs/ecma402-abstract';
import { ToLocalTime } from './ToLocalTime';
import { FormatDateTimePattern, } from './FormatDateTimePattern';
var TABLE_2_FIELDS = [

@@ -19,8 +16,8 @@ 'era',

];
function PartitionDateTimeRangePattern(dtf, x, y, implDetails) {
x = (0, ecma402_abstract_1.TimeClip)(x);
export function PartitionDateTimeRangePattern(dtf, x, y, implDetails) {
x = TimeClip(x);
if (isNaN(x)) {
throw new RangeError('Invalid start time');
}
y = (0, ecma402_abstract_1.TimeClip)(y);
y = TimeClip(y);
if (isNaN(y)) {

@@ -33,6 +30,6 @@ throw new RangeError('Invalid end time');

/** IMPL END */
var tm1 = (0, ToLocalTime_1.ToLocalTime)(x,
var tm1 = ToLocalTime(x,
// @ts-ignore
internalSlots.calendar, internalSlots.timeZone, { tzData: tzData });
var tm2 = (0, ToLocalTime_1.ToLocalTime)(y,
var tm2 = ToLocalTime(y,
// @ts-ignore

@@ -70,3 +67,3 @@ internalSlots.calendar, internalSlots.timeZone, { tzData: tzData });

var v2 = Math.floor(tm2.millisecond * Math.pow(10, (fractionalSecondDigits - 3)));
if (!(0, ecma402_abstract_1.SameValue)(v1, v2)) {
if (!SameValue(v1, v2)) {
dateFieldsPracticallyEqual = false;

@@ -78,3 +75,3 @@ }

var v2 = tm2[fieldName];
if (!(0, ecma402_abstract_1.SameValue)(v1, v2)) {
if (!SameValue(v1, v2)) {
dateFieldsPracticallyEqual = false;

@@ -87,6 +84,6 @@ }

if (dateFieldsPracticallyEqual) {
var result_2 = (0, FormatDateTimePattern_1.FormatDateTimePattern)(dtf, (0, ecma402_abstract_1.PartitionPattern)(pattern), x, implDetails);
var result_2 = FormatDateTimePattern(dtf, PartitionPattern(pattern), x, implDetails);
for (var _a = 0, result_1 = result_2; _a < result_1.length; _a++) {
var r = result_1[_a];
r.source = ecma402_abstract_1.RangePatternType.shared;
r.source = RangePatternType.shared;
}

@@ -111,4 +108,4 @@ return result_2;

var z = void 0;
if (source === ecma402_abstract_1.RangePatternType.startRange ||
source === ecma402_abstract_1.RangePatternType.shared) {
if (source === RangePatternType.startRange ||
source === RangePatternType.shared) {
z = x;

@@ -119,4 +116,4 @@ }

}
var patternParts = (0, ecma402_abstract_1.PartitionPattern)(pattern_1);
var partResult = (0, FormatDateTimePattern_1.FormatDateTimePattern)(dtf, patternParts, z, implDetails);
var patternParts = PartitionPattern(pattern_1);
var partResult = FormatDateTimePattern(dtf, patternParts, z, implDetails);
for (var _f = 0, partResult_1 = partResult; _f < partResult_1.length; _f++) {

@@ -130,2 +127,1 @@ var r = partResult_1[_f];

}
exports.PartitionDateTimeRangePattern = PartitionDateTimeRangePattern;

@@ -1,6 +0,3 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.splitRangePattern = exports.splitFallbackRangePattern = exports.parseDateTimeSkeleton = exports.processDateTimePattern = void 0;
var tslib_1 = require("tslib");
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
import { __assign } from "tslib";
import { RangePatternType, } from '@formatjs/ecma402-abstract';
/**

@@ -114,3 +111,3 @@ * https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table

case 'Z': // 1..3, 4, 5: The ISO8601 varios formats
case 'O': // 1, 4: miliseconds in day short, long
case 'O': // 1, 4: milliseconds in day short, long
case 'v': // 1, 4: generic non-location format

@@ -170,3 +167,3 @@ case 'V': // 1, 2, 3, 4: time zone ID or city

}
function processDateTimePattern(pattern, result) {
export function processDateTimePattern(pattern, result) {
var literals = [];

@@ -200,3 +197,2 @@ // Use skeleton to populate result, but use mapped pattern to populate pattern

}
exports.processDateTimePattern = processDateTimePattern;
/**

@@ -208,3 +204,3 @@ * Parse Date time skeleton into Intl.DateTimeFormatOptions

*/
function parseDateTimeSkeleton(skeleton, rawPattern, rangePatterns, intervalFormatFallback) {
export function parseDateTimeSkeleton(skeleton, rawPattern, rangePatterns, intervalFormatFallback) {
if (rawPattern === void 0) { rawPattern = skeleton; }

@@ -227,4 +223,4 @@ var result = {

var _a = processDateTimePattern(rawPattern_1, intervalResult), pattern_1 = _a[0], pattern12_1 = _a[1];
result.rangePatterns[key] = tslib_1.__assign(tslib_1.__assign({}, intervalResult), { patternParts: splitRangePattern(pattern_1) });
result.rangePatterns12[key] = tslib_1.__assign(tslib_1.__assign({}, intervalResult), { patternParts: splitRangePattern(pattern12_1) });
result.rangePatterns[key] = __assign(__assign({}, intervalResult), { patternParts: splitRangePattern(pattern_1) });
result.rangePatterns12[key] = __assign(__assign({}, intervalResult), { patternParts: splitRangePattern(pattern12_1) });
}

@@ -248,4 +244,3 @@ }

}
exports.parseDateTimeSkeleton = parseDateTimeSkeleton;
function splitFallbackRangePattern(pattern) {
export function splitFallbackRangePattern(pattern) {
var parts = pattern.split(/(\{[0|1]\})/g).filter(Boolean);

@@ -256,3 +251,3 @@ return parts.map(function (pattern) {

return {
source: ecma402_abstract_1.RangePatternType.startRange,
source: RangePatternType.startRange,
pattern: pattern,

@@ -262,3 +257,3 @@ };

return {
source: ecma402_abstract_1.RangePatternType.endRange,
source: RangePatternType.endRange,
pattern: pattern,

@@ -268,3 +263,3 @@ };

return {
source: ecma402_abstract_1.RangePatternType.shared,
source: RangePatternType.shared,
pattern: pattern,

@@ -275,4 +270,3 @@ };

}
exports.splitFallbackRangePattern = splitFallbackRangePattern;
function splitRangePattern(pattern) {
export function splitRangePattern(pattern) {
var PART_REGEX = /\{(.*?)\}/g;

@@ -295,3 +289,3 @@ // Map of part and index within the string

{
source: ecma402_abstract_1.RangePatternType.startRange,
source: RangePatternType.startRange,
pattern: pattern,

@@ -303,7 +297,7 @@ },

{
source: ecma402_abstract_1.RangePatternType.startRange,
source: RangePatternType.startRange,
pattern: pattern.slice(0, splitIndex),
},
{
source: ecma402_abstract_1.RangePatternType.endRange,
source: RangePatternType.endRange,
pattern: pattern.slice(splitIndex),

@@ -313,2 +307,1 @@ },

}
exports.splitRangePattern = splitRangePattern;

@@ -1,5 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ToDateTimeOptions = void 0;
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
import { ToObject } from '@formatjs/ecma402-abstract';
/**

@@ -11,3 +8,3 @@ * https://tc39.es/ecma402/#sec-todatetimeoptions

*/
function ToDateTimeOptions(options, required, defaults) {
export function ToDateTimeOptions(options, required, defaults) {
if (options === undefined) {

@@ -17,3 +14,3 @@ options = null;

else {
options = (0, ecma402_abstract_1.ToObject)(options);
options = ToObject(options);
}

@@ -69,2 +66,1 @@ options = Object.create(options);

}
exports.ToDateTimeOptions = ToDateTimeOptions;

@@ -1,5 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ToLocalTime = void 0;
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
import { Type, YearFromTime, WeekDay, MonthFromTime, DateFromTime, HourFromTime, MinFromTime, SecFromTime, msFromTime, invariant, } from '@formatjs/ecma402-abstract';
function getApplicableZoneData(t, timeZone, tzData) {

@@ -30,11 +27,11 @@ var _a;

*/
function ToLocalTime(t, calendar, timeZone, _a) {
export function ToLocalTime(t, calendar, timeZone, _a) {
var tzData = _a.tzData;
(0, ecma402_abstract_1.invariant)((0, ecma402_abstract_1.Type)(t) === 'Number', 'invalid time');
(0, ecma402_abstract_1.invariant)(calendar === 'gregory', 'We only support Gregory calendar right now');
invariant(Type(t) === 'Number', 'invalid time');
invariant(calendar === 'gregory', 'We only support Gregory calendar right now');
var _b = getApplicableZoneData(t, timeZone, tzData), timeZoneOffset = _b[0], inDST = _b[1];
var tz = t + timeZoneOffset;
var year = (0, ecma402_abstract_1.YearFromTime)(tz);
var year = YearFromTime(tz);
return {
weekday: (0, ecma402_abstract_1.WeekDay)(tz),
weekday: WeekDay(tz),
era: year < 0 ? 'BC' : 'AD',

@@ -44,8 +41,8 @@ year: year,

yearName: undefined,
month: (0, ecma402_abstract_1.MonthFromTime)(tz),
day: (0, ecma402_abstract_1.DateFromTime)(tz),
hour: (0, ecma402_abstract_1.HourFromTime)(tz),
minute: (0, ecma402_abstract_1.MinFromTime)(tz),
second: (0, ecma402_abstract_1.SecFromTime)(tz),
millisecond: (0, ecma402_abstract_1.msFromTime)(tz),
month: MonthFromTime(tz),
day: DateFromTime(tz),
hour: HourFromTime(tz),
minute: MinFromTime(tz),
second: SecFromTime(tz),
millisecond: msFromTime(tz),
inDST: inDST,

@@ -56,2 +53,1 @@ // IMPORTANT: Not in spec

}
exports.ToLocalTime = ToLocalTime;

@@ -1,5 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.offsetPenalty = exports.shortMorePenalty = exports.shortLessPenalty = exports.longMorePenalty = exports.longLessPenalty = exports.differentNumericTypePenalty = exports.additionPenalty = exports.removalPenalty = exports.DATE_TIME_PROPS = void 0;
exports.DATE_TIME_PROPS = [
export var DATE_TIME_PROPS = [
'weekday',

@@ -17,9 +14,9 @@ 'era',

];
exports.removalPenalty = 120;
exports.additionPenalty = 20;
exports.differentNumericTypePenalty = 15;
exports.longLessPenalty = 8;
exports.longMorePenalty = 6;
exports.shortLessPenalty = 6;
exports.shortMorePenalty = 3;
exports.offsetPenalty = 1;
export var removalPenalty = 120;
export var additionPenalty = 20;
export var differentNumericTypePenalty = 15;
export var longLessPenalty = 8;
export var longMorePenalty = 6;
export var shortLessPenalty = 6;
export var shortMorePenalty = 3;
export var offsetPenalty = 1;

@@ -1,18 +0,15 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DateTimeFormat = void 0;
var tslib_1 = require("tslib");
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
var get_internal_slots_1 = tslib_1.__importDefault(require("./get_internal_slots"));
var links_1 = tslib_1.__importDefault(require("./data/links"));
var packer_1 = require("./packer");
var FormatDateTime_1 = require("./abstract/FormatDateTime");
var InitializeDateTimeFormat_1 = require("./abstract/InitializeDateTimeFormat");
var utils_1 = require("./abstract/utils");
var FormatDateTimeToParts_1 = require("./abstract/FormatDateTimeToParts");
var FormatDateTimeRangeToParts_1 = require("./abstract/FormatDateTimeRangeToParts");
var FormatDateTimeRange_1 = require("./abstract/FormatDateTimeRange");
var skeleton_1 = require("./abstract/skeleton");
var UPPERCASED_LINKS = Object.keys(links_1.default).reduce(function (all, l) {
all[l.toUpperCase()] = links_1.default[l];
import { __assign, __rest } from "tslib";
import { invariant, defineProperty, SupportedLocales, IsValidTimeZoneName, CanonicalizeTimeZoneName, CanonicalizeLocaleList, ToNumber, OrdinaryHasInstance, } from '@formatjs/ecma402-abstract';
import getInternalSlots from './get_internal_slots';
import links from './data/links';
import { unpack } from './packer';
import { FormatDateTime } from './abstract/FormatDateTime';
import { InitializeDateTimeFormat } from './abstract/InitializeDateTimeFormat';
import { DATE_TIME_PROPS } from './abstract/utils';
import { FormatDateTimeToParts } from './abstract/FormatDateTimeToParts';
import { FormatDateTimeRangeToParts } from './abstract/FormatDateTimeRangeToParts';
import { FormatDateTimeRange } from './abstract/FormatDateTimeRange';
import { parseDateTimeSkeleton } from './abstract/skeleton';
var UPPERCASED_LINKS = Object.keys(links).reduce(function (all, l) {
all[l.toUpperCase()] = links[l];
return all;

@@ -43,6 +40,6 @@ }, {});

if (typeof this !== 'object' ||
!(0, ecma402_abstract_1.OrdinaryHasInstance)(exports.DateTimeFormat, this)) {
!OrdinaryHasInstance(DateTimeFormat, this)) {
throw TypeError('Intl.DateTimeFormat format property accessor called on incompatible receiver');
}
var internalSlots = (0, get_internal_slots_1.default)(this);
var internalSlots = getInternalSlots(this);
// eslint-disable-next-line @typescript-eslint/no-this-alias

@@ -61,7 +58,7 @@ var dtf = this;

}
return (0, FormatDateTime_1.FormatDateTime)(dtf, x, {
getInternalSlots: get_internal_slots_1.default,
localeData: exports.DateTimeFormat.localeData,
tzData: exports.DateTimeFormat.tzData,
getDefaultTimeZone: exports.DateTimeFormat.getDefaultTimeZone,
return FormatDateTime(dtf, x, {
getInternalSlots: getInternalSlots,
localeData: DateTimeFormat.localeData,
tzData: DateTimeFormat.tzData,
getDefaultTimeZone: DateTimeFormat.getDefaultTimeZone,
});

@@ -100,37 +97,37 @@ };

}
exports.DateTimeFormat = function (locales, options) {
export var DateTimeFormat = function (locales, options) {
// Cannot use `new.target` bc of IE11 & TS transpiles it to something else
if (!this || !(0, ecma402_abstract_1.OrdinaryHasInstance)(exports.DateTimeFormat, this)) {
return new exports.DateTimeFormat(locales, options);
if (!this || !OrdinaryHasInstance(DateTimeFormat, this)) {
return new DateTimeFormat(locales, options);
}
(0, InitializeDateTimeFormat_1.InitializeDateTimeFormat)(this, locales, options, {
tzData: exports.DateTimeFormat.tzData,
InitializeDateTimeFormat(this, locales, options, {
tzData: DateTimeFormat.tzData,
uppercaseLinks: UPPERCASED_LINKS,
availableLocales: exports.DateTimeFormat.availableLocales,
relevantExtensionKeys: exports.DateTimeFormat.relevantExtensionKeys,
getDefaultLocale: exports.DateTimeFormat.getDefaultLocale,
getDefaultTimeZone: exports.DateTimeFormat.getDefaultTimeZone,
getInternalSlots: get_internal_slots_1.default,
localeData: exports.DateTimeFormat.localeData,
availableLocales: DateTimeFormat.availableLocales,
relevantExtensionKeys: DateTimeFormat.relevantExtensionKeys,
getDefaultLocale: DateTimeFormat.getDefaultLocale,
getDefaultTimeZone: DateTimeFormat.getDefaultTimeZone,
getInternalSlots: getInternalSlots,
localeData: DateTimeFormat.localeData,
});
/** IMPL START */
var internalSlots = (0, get_internal_slots_1.default)(this);
var internalSlots = getInternalSlots(this);
var dataLocale = internalSlots.dataLocale;
var dataLocaleData = exports.DateTimeFormat.localeData[dataLocale];
(0, ecma402_abstract_1.invariant)(dataLocaleData !== undefined, "Cannot load locale-dependent data for ".concat(dataLocale, "."));
var dataLocaleData = DateTimeFormat.localeData[dataLocale];
invariant(dataLocaleData !== undefined, "Cannot load locale-dependent data for ".concat(dataLocale, "."));
/** IMPL END */
};
// Static properties
(0, ecma402_abstract_1.defineProperty)(exports.DateTimeFormat, 'supportedLocalesOf', {
defineProperty(DateTimeFormat, 'supportedLocalesOf', {
value: function supportedLocalesOf(locales, options) {
return (0, ecma402_abstract_1.SupportedLocales)(exports.DateTimeFormat.availableLocales, (0, ecma402_abstract_1.CanonicalizeLocaleList)(locales), options);
return SupportedLocales(DateTimeFormat.availableLocales, CanonicalizeLocaleList(locales), options);
},
});
(0, ecma402_abstract_1.defineProperty)(exports.DateTimeFormat.prototype, 'resolvedOptions', {
defineProperty(DateTimeFormat.prototype, 'resolvedOptions', {
value: function resolvedOptions() {
if (typeof this !== 'object' ||
!(0, ecma402_abstract_1.OrdinaryHasInstance)(exports.DateTimeFormat, this)) {
!OrdinaryHasInstance(DateTimeFormat, this)) {
throw TypeError('Method Intl.DateTimeFormat.prototype.resolvedOptions called on incompatible receiver');
}
var internalSlots = (0, get_internal_slots_1.default)(this);
var internalSlots = getInternalSlots(this);
var ro = {};

@@ -150,3 +147,3 @@ for (var _i = 0, RESOLVED_OPTIONS_KEYS_1 = RESOLVED_OPTIONS_KEYS; _i < RESOLVED_OPTIONS_KEYS_1.length; _i++) {

}
if (utils_1.DATE_TIME_PROPS.indexOf(key) > -1) {
if (DATE_TIME_PROPS.indexOf(key) > -1) {
if (internalSlots.dateStyle !== undefined ||

@@ -164,3 +161,3 @@ internalSlots.timeStyle !== undefined) {

});
(0, ecma402_abstract_1.defineProperty)(exports.DateTimeFormat.prototype, 'formatToParts', {
defineProperty(DateTimeFormat.prototype, 'formatToParts', {
value: function formatToParts(date) {

@@ -171,13 +168,13 @@ if (date === undefined) {

else {
date = (0, ecma402_abstract_1.ToNumber)(date);
date = ToNumber(date);
}
return (0, FormatDateTimeToParts_1.FormatDateTimeToParts)(this, date, {
getInternalSlots: get_internal_slots_1.default,
localeData: exports.DateTimeFormat.localeData,
tzData: exports.DateTimeFormat.tzData,
getDefaultTimeZone: exports.DateTimeFormat.getDefaultTimeZone,
return FormatDateTimeToParts(this, date, {
getInternalSlots: getInternalSlots,
localeData: DateTimeFormat.localeData,
tzData: DateTimeFormat.tzData,
getDefaultTimeZone: DateTimeFormat.getDefaultTimeZone,
});
},
});
(0, ecma402_abstract_1.defineProperty)(exports.DateTimeFormat.prototype, 'formatRangeToParts', {
defineProperty(DateTimeFormat.prototype, 'formatRangeToParts', {
value: function formatRangeToParts(startDate, endDate) {

@@ -191,13 +188,13 @@ var dtf = this;

}
var x = (0, ecma402_abstract_1.ToNumber)(startDate);
var y = (0, ecma402_abstract_1.ToNumber)(endDate);
return (0, FormatDateTimeRangeToParts_1.FormatDateTimeRangeToParts)(dtf, x, y, {
getInternalSlots: get_internal_slots_1.default,
localeData: exports.DateTimeFormat.localeData,
tzData: exports.DateTimeFormat.tzData,
getDefaultTimeZone: exports.DateTimeFormat.getDefaultTimeZone,
var x = ToNumber(startDate);
var y = ToNumber(endDate);
return FormatDateTimeRangeToParts(dtf, x, y, {
getInternalSlots: getInternalSlots,
localeData: DateTimeFormat.localeData,
tzData: DateTimeFormat.tzData,
getDefaultTimeZone: DateTimeFormat.getDefaultTimeZone,
});
},
});
(0, ecma402_abstract_1.defineProperty)(exports.DateTimeFormat.prototype, 'formatRange', {
defineProperty(DateTimeFormat.prototype, 'formatRange', {
value: function formatRange(startDate, endDate) {

@@ -211,9 +208,9 @@ var dtf = this;

}
var x = (0, ecma402_abstract_1.ToNumber)(startDate);
var y = (0, ecma402_abstract_1.ToNumber)(endDate);
return (0, FormatDateTimeRange_1.FormatDateTimeRange)(dtf, x, y, {
getInternalSlots: get_internal_slots_1.default,
localeData: exports.DateTimeFormat.localeData,
tzData: exports.DateTimeFormat.tzData,
getDefaultTimeZone: exports.DateTimeFormat.getDefaultTimeZone,
var x = ToNumber(startDate);
var y = ToNumber(endDate);
return FormatDateTimeRange(dtf, x, y, {
getInternalSlots: getInternalSlots,
localeData: DateTimeFormat.localeData,
tzData: DateTimeFormat.tzData,
getDefaultTimeZone: DateTimeFormat.getDefaultTimeZone,
});

@@ -223,7 +220,7 @@ },

var DEFAULT_TIMEZONE = 'UTC';
exports.DateTimeFormat.__setDefaultTimeZone = function (timeZone) {
DateTimeFormat.__setDefaultTimeZone = function (timeZone) {
if (timeZone !== undefined) {
timeZone = String(timeZone);
if (!(0, ecma402_abstract_1.IsValidTimeZoneName)(timeZone, {
tzData: exports.DateTimeFormat.tzData,
if (!IsValidTimeZoneName(timeZone, {
tzData: DateTimeFormat.tzData,
uppercaseLinks: UPPERCASED_LINKS,

@@ -233,4 +230,4 @@ })) {

}
timeZone = (0, ecma402_abstract_1.CanonicalizeTimeZoneName)(timeZone, {
tzData: exports.DateTimeFormat.tzData,
timeZone = CanonicalizeTimeZoneName(timeZone, {
tzData: DateTimeFormat.tzData,
uppercaseLinks: UPPERCASED_LINKS,

@@ -242,8 +239,8 @@ });

}
exports.DateTimeFormat.__defaultTimeZone = timeZone;
DateTimeFormat.__defaultTimeZone = timeZone;
};
exports.DateTimeFormat.relevantExtensionKeys = ['nu', 'ca', 'hc'];
exports.DateTimeFormat.__defaultTimeZone = DEFAULT_TIMEZONE;
exports.DateTimeFormat.getDefaultTimeZone = function () { return exports.DateTimeFormat.__defaultTimeZone; };
exports.DateTimeFormat.__addLocaleData = function __addLocaleData() {
DateTimeFormat.relevantExtensionKeys = ['nu', 'ca', 'hc'];
DateTimeFormat.__defaultTimeZone = DEFAULT_TIMEZONE;
DateTimeFormat.getDefaultTimeZone = function () { return DateTimeFormat.__defaultTimeZone; };
DateTimeFormat.__addLocaleData = function __addLocaleData() {
var data = [];

@@ -254,22 +251,22 @@ for (var _i = 0; _i < arguments.length; _i++) {

var _loop_1 = function (d, locale) {
var dateFormat = d.dateFormat, timeFormat = d.timeFormat, dateTimeFormat = d.dateTimeFormat, formats = d.formats, intervalFormats = d.intervalFormats, rawData = tslib_1.__rest(d, ["dateFormat", "timeFormat", "dateTimeFormat", "formats", "intervalFormats"]);
var processedData = tslib_1.__assign(tslib_1.__assign({}, rawData), { dateFormat: {
full: (0, skeleton_1.parseDateTimeSkeleton)(dateFormat.full),
long: (0, skeleton_1.parseDateTimeSkeleton)(dateFormat.long),
medium: (0, skeleton_1.parseDateTimeSkeleton)(dateFormat.medium),
short: (0, skeleton_1.parseDateTimeSkeleton)(dateFormat.short),
var dateFormat = d.dateFormat, timeFormat = d.timeFormat, dateTimeFormat = d.dateTimeFormat, formats = d.formats, intervalFormats = d.intervalFormats, rawData = __rest(d, ["dateFormat", "timeFormat", "dateTimeFormat", "formats", "intervalFormats"]);
var processedData = __assign(__assign({}, rawData), { dateFormat: {
full: parseDateTimeSkeleton(dateFormat.full),
long: parseDateTimeSkeleton(dateFormat.long),
medium: parseDateTimeSkeleton(dateFormat.medium),
short: parseDateTimeSkeleton(dateFormat.short),
}, timeFormat: {
full: (0, skeleton_1.parseDateTimeSkeleton)(timeFormat.full),
long: (0, skeleton_1.parseDateTimeSkeleton)(timeFormat.long),
medium: (0, skeleton_1.parseDateTimeSkeleton)(timeFormat.medium),
short: (0, skeleton_1.parseDateTimeSkeleton)(timeFormat.short),
full: parseDateTimeSkeleton(timeFormat.full),
long: parseDateTimeSkeleton(timeFormat.long),
medium: parseDateTimeSkeleton(timeFormat.medium),
short: parseDateTimeSkeleton(timeFormat.short),
}, dateTimeFormat: {
full: (0, skeleton_1.parseDateTimeSkeleton)(dateTimeFormat.full).pattern,
long: (0, skeleton_1.parseDateTimeSkeleton)(dateTimeFormat.long).pattern,
medium: (0, skeleton_1.parseDateTimeSkeleton)(dateTimeFormat.medium).pattern,
short: (0, skeleton_1.parseDateTimeSkeleton)(dateTimeFormat.short).pattern,
full: parseDateTimeSkeleton(dateTimeFormat.full).pattern,
long: parseDateTimeSkeleton(dateTimeFormat.long).pattern,
medium: parseDateTimeSkeleton(dateTimeFormat.medium).pattern,
short: parseDateTimeSkeleton(dateTimeFormat.short).pattern,
}, formats: {} });
var _loop_2 = function (calendar) {
processedData.formats[calendar] = Object.keys(formats[calendar]).map(function (skeleton) {
return (0, skeleton_1.parseDateTimeSkeleton)(skeleton, formats[calendar][skeleton], intervalFormats[skeleton], intervalFormats.intervalFormatFallback);
return parseDateTimeSkeleton(skeleton, formats[calendar][skeleton], intervalFormats[skeleton], intervalFormats.intervalFormatFallback);
});

@@ -283,7 +280,7 @@ };

.toString();
exports.DateTimeFormat.localeData[locale] = exports.DateTimeFormat.localeData[minimizedLocale] = processedData;
exports.DateTimeFormat.availableLocales.add(locale);
exports.DateTimeFormat.availableLocales.add(minimizedLocale);
if (!exports.DateTimeFormat.__defaultLocale) {
exports.DateTimeFormat.__defaultLocale = minimizedLocale;
DateTimeFormat.localeData[locale] = DateTimeFormat.localeData[minimizedLocale] = processedData;
DateTimeFormat.availableLocales.add(locale);
DateTimeFormat.availableLocales.add(minimizedLocale);
if (!DateTimeFormat.__defaultLocale) {
DateTimeFormat.__defaultLocale = minimizedLocale;
}

@@ -296,17 +293,17 @@ };

};
Object.defineProperty(exports.DateTimeFormat.prototype, 'format', formatDescriptor);
exports.DateTimeFormat.__defaultLocale = '';
exports.DateTimeFormat.localeData = {};
exports.DateTimeFormat.availableLocales = new Set();
exports.DateTimeFormat.getDefaultLocale = function () {
return exports.DateTimeFormat.__defaultLocale;
Object.defineProperty(DateTimeFormat.prototype, 'format', formatDescriptor);
DateTimeFormat.__defaultLocale = '';
DateTimeFormat.localeData = {};
DateTimeFormat.availableLocales = new Set();
DateTimeFormat.getDefaultLocale = function () {
return DateTimeFormat.__defaultLocale;
};
exports.DateTimeFormat.polyfilled = true;
exports.DateTimeFormat.tzData = {};
exports.DateTimeFormat.__addTZData = function (d) {
exports.DateTimeFormat.tzData = (0, packer_1.unpack)(d);
DateTimeFormat.polyfilled = true;
DateTimeFormat.tzData = {};
DateTimeFormat.__addTZData = function (d) {
DateTimeFormat.tzData = unpack(d);
};
try {
if (typeof Symbol !== 'undefined') {
Object.defineProperty(exports.DateTimeFormat.prototype, Symbol.toStringTag, {
Object.defineProperty(DateTimeFormat.prototype, Symbol.toStringTag, {
value: 'Intl.DateTimeFormat',

@@ -318,3 +315,3 @@ writable: false,

}
Object.defineProperty(exports.DateTimeFormat.prototype.constructor, 'length', {
Object.defineProperty(DateTimeFormat.prototype.constructor, 'length', {
value: 1,

@@ -321,0 +318,0 @@ writable: false,

@@ -1,6 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// @generated
// prettier-ignore
exports.default = {
export default {
"Africa/Accra": "Africa/Abidjan",

@@ -7,0 +5,0 @@ "Africa/Addis_Ababa": "Africa/Nairobi",

@@ -1,7 +0,5 @@

"use strict";
// Type-only circular import
// eslint-disable-next-line import/no-cycle
Object.defineProperty(exports, "__esModule", { value: true });
var internalSlotMap = new WeakMap();
function getInternalSlots(x) {
export default function getInternalSlots(x) {
var internalSlots = internalSlotMap.get(x);

@@ -14,2 +12,1 @@ if (!internalSlots) {

}
exports.default = getInternalSlots;

@@ -1,6 +0,3 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.unpack = exports.pack = void 0;
var tslib_1 = require("tslib");
function pack(data) {
import { __spreadArray } from "tslib";
export function pack(data) {
var zoneNames = Object.keys(data.zones);

@@ -10,7 +7,7 @@ zoneNames.sort(); // so output is stable

zones: zoneNames.map(function (zone) {
return tslib_1.__spreadArray([
return __spreadArray([
zone
], data.zones[zone].map(function (_a) {
var ts = _a[0], others = _a.slice(1);
return tslib_1.__spreadArray([ts === '' ? '' : ts.toString(36)], others, true).join(',');
return __spreadArray([ts === '' ? '' : ts.toString(36)], others, true).join(',');
}), true).join('|');

@@ -22,4 +19,3 @@ }),

}
exports.pack = pack;
function unpack(data) {
export function unpack(data) {
var abbrvs = data.abbrvs.split('|');

@@ -46,2 +42,1 @@ var offsets = data.offsets.split('|').map(function (n) { return parseInt(n, 36); });

}
exports.unpack = unpack;

@@ -1,7 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toLocaleTimeString = exports.toLocaleDateString = exports.toLocaleString = void 0;
// eslint-disable-next-line import/no-cycle
var core_1 = require("./core");
var ToDateTimeOptions_1 = require("./abstract/ToDateTimeOptions");
import { DateTimeFormat } from './core';
import { ToDateTimeOptions } from './abstract/ToDateTimeOptions';
/**

@@ -11,16 +8,13 @@ * Number.prototype.toLocaleString ponyfill

*/
function toLocaleString(x, locales, options) {
var dtf = new core_1.DateTimeFormat(locales, options);
export function toLocaleString(x, locales, options) {
var dtf = new DateTimeFormat(locales, options);
return dtf.format(x);
}
exports.toLocaleString = toLocaleString;
function toLocaleDateString(x, locales, options) {
var dtf = new core_1.DateTimeFormat(locales, (0, ToDateTimeOptions_1.ToDateTimeOptions)(options, 'date', 'date'));
export function toLocaleDateString(x, locales, options) {
var dtf = new DateTimeFormat(locales, ToDateTimeOptions(options, 'date', 'date'));
return dtf.format(x);
}
exports.toLocaleDateString = toLocaleDateString;
function toLocaleTimeString(x, locales, options) {
var dtf = new core_1.DateTimeFormat(locales, (0, ToDateTimeOptions_1.ToDateTimeOptions)(options, 'time', 'time'));
export function toLocaleTimeString(x, locales, options) {
var dtf = new DateTimeFormat(locales, ToDateTimeOptions(options, 'time', 'time'));
return dtf.format(x);
}
exports.toLocaleTimeString = toLocaleTimeString;

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,4 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.supportedLocales = void 0;
exports.supportedLocales = ["af", "af-NA", "agq", "ak", "am", "ar", "ar-AE", "ar-BH", "ar-DJ", "ar-DZ", "ar-EG", "ar-EH", "ar-ER", "ar-IL", "ar-IQ", "ar-JO", "ar-KM", "ar-KW", "ar-LB", "ar-LY", "ar-MA", "ar-MR", "ar-OM", "ar-PS", "ar-QA", "ar-SA", "ar-SD", "ar-SO", "ar-SS", "ar-SY", "ar-TD", "ar-TN", "ar-YE", "as", "asa", "ast", "az", "az-Cyrl", "az-Latn", "bas", "be", "be-tarask", "bem", "bez", "bg", "bm", "bn", "bn-IN", "bo", "bo-IN", "br", "brx", "bs", "bs-Cyrl", "bs-Latn", "ca", "ca-AD", "ca-ES-valencia", "ca-FR", "ca-IT", "ccp", "ccp-IN", "ce", "ceb", "cgg", "chr", "ckb", "ckb-IR", "cs", "cy", "da", "da-GL", "dav", "de", "de-AT", "de-BE", "de-CH", "de-IT", "de-LI", "de-LU", "dje", "doi", "dsb", "dua", "dyo", "dz", "ebu", "ee", "ee-TG", "el", "el-CY", "en", "en-001", "en-150", "en-AE", "en-AG", "en-AI", "en-AS", "en-AT", "en-AU", "en-BB", "en-BE", "en-BI", "en-BM", "en-BS", "en-BW", "en-BZ", "en-CA", "en-CC", "en-CH", "en-CK", "en-CM", "en-CX", "en-CY", "en-DE", "en-DG", "en-DK", "en-DM", "en-ER", "en-FI", "en-FJ", "en-FK", "en-FM", "en-GB", "en-GD", "en-GG", "en-GH", "en-GI", "en-GM", "en-GU", "en-GY", "en-HK", "en-IE", "en-IL", "en-IM", "en-IN", "en-IO", "en-JE", "en-JM", "en-KE", "en-KI", "en-KN", "en-KY", "en-LC", "en-LR", "en-LS", "en-MG", "en-MH", "en-MO", "en-MP", "en-MS", "en-MT", "en-MU", "en-MW", "en-MY", "en-NA", "en-NF", "en-NG", "en-NL", "en-NR", "en-NU", "en-NZ", "en-PG", "en-PH", "en-PK", "en-PN", "en-PR", "en-PW", "en-RW", "en-SB", "en-SC", "en-SD", "en-SE", "en-SG", "en-SH", "en-SI", "en-SL", "en-SS", "en-SX", "en-SZ", "en-TC", "en-TK", "en-TO", "en-TT", "en-TV", "en-TZ", "en-UG", "en-UM", "en-VC", "en-VG", "en-VI", "en-VU", "en-WS", "en-ZA", "en-ZM", "en-ZW", "eo", "es", "es-419", "es-AR", "es-BO", "es-BR", "es-BZ", "es-CL", "es-CO", "es-CR", "es-CU", "es-DO", "es-EA", "es-EC", "es-GQ", "es-GT", "es-HN", "es-IC", "es-MX", "es-NI", "es-PA", "es-PE", "es-PH", "es-PR", "es-PY", "es-SV", "es-US", "es-UY", "es-VE", "et", "eu", "ewo", "fa", "fa-AF", "ff", "ff-Adlm", "ff-Adlm-BF", "ff-Adlm-CM", "ff-Adlm-GH", "ff-Adlm-GM", "ff-Adlm-GW", "ff-Adlm-LR", "ff-Adlm-MR", "ff-Adlm-NE", "ff-Adlm-NG", "ff-Adlm-SL", "ff-Adlm-SN", "ff-Latn", "ff-Latn-BF", "ff-Latn-CM", "ff-Latn-GH", "ff-Latn-GM", "ff-Latn-GN", "ff-Latn-GW", "ff-Latn-LR", "ff-Latn-MR", "ff-Latn-NE", "ff-Latn-NG", "ff-Latn-SL", "fi", "fil", "fo", "fo-DK", "fr", "fr-BE", "fr-BF", "fr-BI", "fr-BJ", "fr-BL", "fr-CA", "fr-CD", "fr-CF", "fr-CG", "fr-CH", "fr-CI", "fr-CM", "fr-DJ", "fr-DZ", "fr-GA", "fr-GF", "fr-GN", "fr-GP", "fr-GQ", "fr-HT", "fr-KM", "fr-LU", "fr-MA", "fr-MC", "fr-MF", "fr-MG", "fr-ML", "fr-MQ", "fr-MR", "fr-MU", "fr-NC", "fr-NE", "fr-PF", "fr-PM", "fr-RE", "fr-RW", "fr-SC", "fr-SN", "fr-SY", "fr-TD", "fr-TG", "fr-TN", "fr-VU", "fr-WF", "fr-YT", "fur", "fy", "ga", "ga-GB", "gd", "gl", "gsw", "gsw-FR", "gsw-LI", "gu", "guz", "gv", "ha", "ha-GH", "ha-NE", "haw", "he", "hi", "hr", "hr-BA", "hsb", "hu", "hy", "ia", "id", "ig", "ii", "is", "it", "it-CH", "it-SM", "it-VA", "ja", "jgo", "jmc", "jv", "ka", "kab", "kam", "kde", "kea", "kgp", "khq", "ki", "kk", "kkj", "kl", "kln", "km", "kn", "ko", "ko-KP", "kok", "ks", "ks-Arab", "ksb", "ksf", "ksh", "ku", "kw", "ky", "lag", "lb", "lg", "lkt", "ln", "ln-AO", "ln-CF", "ln-CG", "lo", "lrc", "lrc-IQ", "lt", "lu", "luo", "luy", "lv", "mai", "mas", "mas-TZ", "mer", "mfe", "mg", "mgh", "mgo", "mi", "mk", "ml", "mn", "mni", "mni-Beng", "mr", "ms", "ms-BN", "ms-ID", "ms-SG", "mt", "mua", "my", "mzn", "naq", "nb", "nb-SJ", "nd", "nds", "nds-NL", "ne", "ne-IN", "nl", "nl-AW", "nl-BE", "nl-BQ", "nl-CW", "nl-SR", "nl-SX", "nmg", "nn", "nnh", "no", "nus", "nyn", "om", "om-KE", "or", "os", "os-RU", "pa", "pa-Arab", "pa-Guru", "pcm", "pl", "ps", "ps-PK", "pt", "pt-AO", "pt-CH", "pt-CV", "pt-GQ", "pt-GW", "pt-LU", "pt-MO", "pt-MZ", "pt-PT", "pt-ST", "pt-TL", "qu", "qu-BO", "qu-EC", "rm", "rn", "ro", "ro-MD", "rof", "ru", "ru-BY", "ru-KG", "ru-KZ", "ru-MD", "ru-UA", "rw", "rwk", "sa", "sah", "saq", "sat", "sat-Olck", "sbp", "sc", "sd", "sd-Arab", "sd-Deva", "se", "se-FI", "se-SE", "seh", "ses", "sg", "shi", "shi-Latn", "shi-Tfng", "si", "sk", "sl", "smn", "sn", "so", "so-DJ", "so-ET", "so-KE", "sq", "sq-MK", "sq-XK", "sr", "sr-Cyrl", "sr-Cyrl-BA", "sr-Cyrl-ME", "sr-Cyrl-XK", "sr-Latn", "sr-Latn-BA", "sr-Latn-ME", "sr-Latn-XK", "su", "su-Latn", "sv", "sv-AX", "sv-FI", "sw", "sw-CD", "sw-KE", "sw-UG", "ta", "ta-LK", "ta-MY", "ta-SG", "te", "teo", "teo-KE", "tg", "th", "ti", "ti-ER", "tk", "to", "tr", "tr-CY", "tt", "twq", "tzm", "ug", "uk", "und", "ur", "ur-IN", "uz", "uz-Arab", "uz-Cyrl", "uz-Latn", "vai", "vai-Latn", "vai-Vaii", "vi", "vun", "wae", "wo", "xh", "xog", "yav", "yi", "yo", "yo-BJ", "yrl", "yrl-CO", "yrl-VE", "yue", "yue-Hans", "yue-Hant", "zgh", "zh", "zh-Hans", "zh-Hans-HK", "zh-Hans-MO", "zh-Hans-SG", "zh-Hant", "zh-Hant-HK", "zh-Hant-MO", "zu"];
export var supportedLocales = ["af", "af-NA", "agq", "ak", "am", "ar", "ar-AE", "ar-BH", "ar-DJ", "ar-DZ", "ar-EG", "ar-EH", "ar-ER", "ar-IL", "ar-IQ", "ar-JO", "ar-KM", "ar-KW", "ar-LB", "ar-LY", "ar-MA", "ar-MR", "ar-OM", "ar-PS", "ar-QA", "ar-SA", "ar-SD", "ar-SO", "ar-SS", "ar-SY", "ar-TD", "ar-TN", "ar-YE", "as", "asa", "ast", "az", "az-Cyrl", "az-Latn", "bas", "be", "be-tarask", "bem", "bez", "bg", "bm", "bn", "bn-IN", "bo", "bo-IN", "br", "brx", "bs", "bs-Cyrl", "bs-Latn", "ca", "ca-AD", "ca-ES-valencia", "ca-FR", "ca-IT", "ccp", "ccp-IN", "ce", "ceb", "cgg", "chr", "ckb", "ckb-IR", "cs", "cy", "da", "da-GL", "dav", "de", "de-AT", "de-BE", "de-CH", "de-IT", "de-LI", "de-LU", "dje", "doi", "dsb", "dua", "dyo", "dz", "ebu", "ee", "ee-TG", "el", "el-CY", "en", "en-001", "en-150", "en-AE", "en-AG", "en-AI", "en-AS", "en-AT", "en-AU", "en-BB", "en-BE", "en-BI", "en-BM", "en-BS", "en-BW", "en-BZ", "en-CA", "en-CC", "en-CH", "en-CK", "en-CM", "en-CX", "en-CY", "en-DE", "en-DG", "en-DK", "en-DM", "en-ER", "en-FI", "en-FJ", "en-FK", "en-FM", "en-GB", "en-GD", "en-GG", "en-GH", "en-GI", "en-GM", "en-GU", "en-GY", "en-HK", "en-IE", "en-IL", "en-IM", "en-IN", "en-IO", "en-JE", "en-JM", "en-KE", "en-KI", "en-KN", "en-KY", "en-LC", "en-LR", "en-LS", "en-MG", "en-MH", "en-MO", "en-MP", "en-MS", "en-MT", "en-MU", "en-MW", "en-MY", "en-NA", "en-NF", "en-NG", "en-NL", "en-NR", "en-NU", "en-NZ", "en-PG", "en-PH", "en-PK", "en-PN", "en-PR", "en-PW", "en-RW", "en-SB", "en-SC", "en-SD", "en-SE", "en-SG", "en-SH", "en-SI", "en-SL", "en-SS", "en-SX", "en-SZ", "en-TC", "en-TK", "en-TO", "en-TT", "en-TV", "en-TZ", "en-UG", "en-UM", "en-VC", "en-VG", "en-VI", "en-VU", "en-WS", "en-ZA", "en-ZM", "en-ZW", "eo", "es", "es-419", "es-AR", "es-BO", "es-BR", "es-BZ", "es-CL", "es-CO", "es-CR", "es-CU", "es-DO", "es-EA", "es-EC", "es-GQ", "es-GT", "es-HN", "es-IC", "es-MX", "es-NI", "es-PA", "es-PE", "es-PH", "es-PR", "es-PY", "es-SV", "es-US", "es-UY", "es-VE", "et", "eu", "ewo", "fa", "fa-AF", "ff", "ff-Adlm", "ff-Adlm-BF", "ff-Adlm-CM", "ff-Adlm-GH", "ff-Adlm-GM", "ff-Adlm-GW", "ff-Adlm-LR", "ff-Adlm-MR", "ff-Adlm-NE", "ff-Adlm-NG", "ff-Adlm-SL", "ff-Adlm-SN", "ff-Latn", "ff-Latn-BF", "ff-Latn-CM", "ff-Latn-GH", "ff-Latn-GM", "ff-Latn-GN", "ff-Latn-GW", "ff-Latn-LR", "ff-Latn-MR", "ff-Latn-NE", "ff-Latn-NG", "ff-Latn-SL", "fi", "fil", "fo", "fo-DK", "fr", "fr-BE", "fr-BF", "fr-BI", "fr-BJ", "fr-BL", "fr-CA", "fr-CD", "fr-CF", "fr-CG", "fr-CH", "fr-CI", "fr-CM", "fr-DJ", "fr-DZ", "fr-GA", "fr-GF", "fr-GN", "fr-GP", "fr-GQ", "fr-HT", "fr-KM", "fr-LU", "fr-MA", "fr-MC", "fr-MF", "fr-MG", "fr-ML", "fr-MQ", "fr-MR", "fr-MU", "fr-NC", "fr-NE", "fr-PF", "fr-PM", "fr-RE", "fr-RW", "fr-SC", "fr-SN", "fr-SY", "fr-TD", "fr-TG", "fr-TN", "fr-VU", "fr-WF", "fr-YT", "fur", "fy", "ga", "ga-GB", "gd", "gl", "gsw", "gsw-FR", "gsw-LI", "gu", "guz", "gv", "ha", "ha-GH", "ha-NE", "haw", "he", "hi", "hr", "hr-BA", "hsb", "hu", "hy", "ia", "id", "ig", "ii", "is", "it", "it-CH", "it-SM", "it-VA", "ja", "jgo", "jmc", "jv", "ka", "kab", "kam", "kde", "kea", "kgp", "khq", "ki", "kk", "kkj", "kl", "kln", "km", "kn", "ko", "ko-KP", "kok", "ks", "ks-Arab", "ksb", "ksf", "ksh", "ku", "kw", "ky", "lag", "lb", "lg", "lkt", "ln", "ln-AO", "ln-CF", "ln-CG", "lo", "lrc", "lrc-IQ", "lt", "lu", "luo", "luy", "lv", "mai", "mas", "mas-TZ", "mer", "mfe", "mg", "mgh", "mgo", "mi", "mk", "ml", "mn", "mni", "mni-Beng", "mr", "ms", "ms-BN", "ms-ID", "ms-SG", "mt", "mua", "my", "mzn", "naq", "nb", "nb-SJ", "nd", "nds", "nds-NL", "ne", "ne-IN", "nl", "nl-AW", "nl-BE", "nl-BQ", "nl-CW", "nl-SR", "nl-SX", "nmg", "nn", "nnh", "no", "nus", "nyn", "om", "om-KE", "or", "os", "os-RU", "pa", "pa-Arab", "pa-Guru", "pcm", "pl", "ps", "ps-PK", "pt", "pt-AO", "pt-CH", "pt-CV", "pt-GQ", "pt-GW", "pt-LU", "pt-MO", "pt-MZ", "pt-PT", "pt-ST", "pt-TL", "qu", "qu-BO", "qu-EC", "rm", "rn", "ro", "ro-MD", "rof", "ru", "ru-BY", "ru-KG", "ru-KZ", "ru-MD", "ru-UA", "rw", "rwk", "sa", "sah", "saq", "sat", "sat-Olck", "sbp", "sc", "sd", "sd-Arab", "sd-Deva", "se", "se-FI", "se-SE", "seh", "ses", "sg", "shi", "shi-Latn", "shi-Tfng", "si", "sk", "sl", "smn", "sn", "so", "so-DJ", "so-ET", "so-KE", "sq", "sq-MK", "sq-XK", "sr", "sr-Cyrl", "sr-Cyrl-BA", "sr-Cyrl-ME", "sr-Cyrl-XK", "sr-Latn", "sr-Latn-BA", "sr-Latn-ME", "sr-Latn-XK", "su", "su-Latn", "sv", "sv-AX", "sv-FI", "sw", "sw-CD", "sw-KE", "sw-UG", "ta", "ta-LK", "ta-MY", "ta-SG", "te", "teo", "teo-KE", "tg", "th", "ti", "ti-ER", "tk", "to", "tr", "tr-CY", "tt", "twq", "tzm", "ug", "uk", "und", "ur", "ur-IN", "uz", "uz-Arab", "uz-Cyrl", "uz-Latn", "vai", "vai-Latn", "vai-Vaii", "vi", "vun", "wae", "wo", "xh", "xog", "yav", "yi", "yo", "yo-BJ", "yrl", "yrl-CO", "yrl-VE", "yue", "yue-Hans", "yue-Hant", "zgh", "zh", "zh-Hans", "zh-Hans-HK", "zh-Hans-MO", "zh-Hans-SG", "zh-Hant", "zh-Hant-HK", "zh-Hant-MO", "zu"];
MIT License
Copyright (c) 2021 FormatJS
Copyright (c) 2023 FormatJS

@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

{
"name": "@formatjs/intl-datetimeformat",
"version": "6.11.3",
"version": "6.12.0",
"description": "Intl.DateTimeFormat polyfill",

@@ -26,9 +26,9 @@ "main": "index.js",

"tslib": "^2.4.0",
"@formatjs/ecma402-abstract": "1.17.4",
"@formatjs/intl-localematcher": "0.5.1"
"@formatjs/ecma402-abstract": "1.18.0",
"@formatjs/intl-localematcher": "0.5.2"
},
"devDependencies": {
"@formatjs/intl-getcanonicallocales": "2.3.0",
"@formatjs/intl-locale": "3.4.2"
"@formatjs/intl-locale": "3.4.3"
}
}

@@ -1,2 +0,2 @@

import { IntlDateTimeFormatInternal, DateTimeFormatLocaleInternalData, DateTimeFormat as DateTimeFormat } from '@formatjs/ecma402-abstract';
import { DateTimeFormat, DateTimeFormatLocaleInternalData, IntlDateTimeFormatInternal } from '@formatjs/ecma402-abstract';
/**

@@ -3,0 +3,0 @@ * https://tc39.es/ecma402/#sec-initializedatetimeformat

@@ -5,8 +5,8 @@ "use strict";

var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
var intl_localematcher_1 = require("@formatjs/intl-localematcher");
var BasicFormatMatcher_1 = require("./BasicFormatMatcher");
var BestFitFormatMatcher_1 = require("./BestFitFormatMatcher");
var utils_1 = require("./utils");
var DateTimeStyleFormat_1 = require("./DateTimeStyleFormat");
var ToDateTimeOptions_1 = require("./ToDateTimeOptions");
var intl_localematcher_1 = require("@formatjs/intl-localematcher");
var utils_1 = require("./utils");
function isTimeRelated(opt) {

@@ -117,5 +117,3 @@ for (var _i = 0, _a = ['hour', 'minute', 'second']; _i < _a.length; _i++) {

], undefined);
opt.fractionalSecondDigits = (0, ecma402_abstract_1.GetNumberOption)(options, 'fractionalSecondDigits', 1, 3,
// @ts-expect-error
undefined);
opt.fractionalSecondDigits = (0, ecma402_abstract_1.GetNumberOption)(options, 'fractionalSecondDigits', 1, 3, undefined);
var dataLocaleData = localeData[dataLocale];

@@ -122,0 +120,0 @@ (0, ecma402_abstract_1.invariant)(!!dataLocaleData, "Missing locale data for ".concat(dataLocale));

@@ -114,3 +114,3 @@ "use strict";

case 'Z': // 1..3, 4, 5: The ISO8601 varios formats
case 'O': // 1, 4: miliseconds in day short, long
case 'O': // 1, 4: milliseconds in day short, long
case 'v': // 1, 4: generic non-location format

@@ -117,0 +117,0 @@ case 'V': // 1, 2, 3, 4: time zone ID or city

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc