@formatjs/intl-locale 5.0.6 → 5.1.1
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/character-orders.generated.d.ts +41 -0
- package/character-orders.generated.js +41 -0
- package/hour-cycles.generated.d.ts +2 -0
- package/hour-cycles.generated.js +7 -0
- package/numbering-systems.generated.d.ts +42 -1
- package/numbering-systems.generated.js +130 -2
- package/package.json +4 -4
- package/polyfill.iife.js +409 -211
- package/should-polyfill.js +33 -1
- package/timezones.generated.d.ts +2 -2
- package/timezones.generated.js +2 -1
- package/week-data.generated.d.ts +2 -2
- package/week-data.generated.js +1 -1
package/should-polyfill.js
CHANGED
|
@@ -9,6 +9,38 @@ function hasIntlGetCanonicalLocalesBug() {
|
|
|
9
9
|
return true;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Check if Intl.Locale is missing critical methods from the Intl Locale Info proposal.
|
|
14
|
+
* Firefox has an incomplete implementation that lacks getWeekInfo() and other methods.
|
|
15
|
+
* https://github.com/formatjs/formatjs/issues/5112
|
|
16
|
+
* https://bugzilla.mozilla.org/show_bug.cgi?id=1693576
|
|
17
|
+
*/
|
|
18
|
+
function hasIncompleteLocaleInfo() {
|
|
19
|
+
try {
|
|
20
|
+
var locale = new Intl.Locale('en-US');
|
|
21
|
+
// Check for getWeekInfo - critical for week calculations (e.g., Luxon's localWeekNumber)
|
|
22
|
+
// This is the most important check as it affects date/time libraries
|
|
23
|
+
if (typeof locale.getWeekInfo !== 'function') {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
// Also check for other Intl Locale Info methods
|
|
27
|
+
// These are part of the same proposal and often missing together
|
|
28
|
+
if (typeof locale.getCalendars !== 'function' ||
|
|
29
|
+
typeof locale.getCollations !== 'function' ||
|
|
30
|
+
typeof locale.getHourCycles !== 'function' ||
|
|
31
|
+
typeof locale.getNumberingSystems !== 'function' ||
|
|
32
|
+
typeof locale.getTimeZones !== 'function' ||
|
|
33
|
+
typeof locale.getTextInfo !== 'function') {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
catch (_a) {
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
12
42
|
export function shouldPolyfill() {
|
|
13
|
-
return !('Locale' in Intl) ||
|
|
43
|
+
return (!('Locale' in Intl) ||
|
|
44
|
+
hasIntlGetCanonicalLocalesBug() ||
|
|
45
|
+
hasIncompleteLocaleInfo());
|
|
14
46
|
}
|
package/timezones.generated.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare const timezones: {
|
|
|
8
8
|
readonly am: readonly ["Asia/Yerevan"];
|
|
9
9
|
readonly an: readonly ["America/Curacao"];
|
|
10
10
|
readonly ao: readonly ["Africa/Luanda"];
|
|
11
|
-
readonly aq: readonly ["
|
|
11
|
+
readonly aq: readonly ["Antarctica/McMurdo", "Antarctica/Casey", "Antarctica/Davis", "Antarctica/DumontDUrville", "Antarctica/Mawson", "Antarctica/McMurdo", "Antarctica/Palmer", "Antarctica/Rothera", "Antarctica/Syowa", "Antarctica/Troll", "Antarctica/Vostok"];
|
|
12
12
|
readonly ar: readonly ["America/Buenos_Aires", "America/Cordoba", "America/Catamarca", "America/Argentina/La_Rioja", "America/Jujuy", "America/Argentina/San_Luis", "America/Mendoza", "America/Argentina/Rio_Gallegos", "America/Argentina/Salta", "America/Argentina/Tucuman", "America/Argentina/San_Juan", "America/Argentina/Ushuaia"];
|
|
13
13
|
readonly as: readonly ["Pacific/Pago_Pago"];
|
|
14
14
|
readonly at: readonly ["Europe/Vienna"];
|
|
@@ -42,7 +42,7 @@ export declare const timezones: {
|
|
|
42
42
|
readonly ch: readonly ["Europe/Zurich"];
|
|
43
43
|
readonly ci: readonly ["Africa/Abidjan"];
|
|
44
44
|
readonly ck: readonly ["Pacific/Rarotonga"];
|
|
45
|
-
readonly cl: readonly ["Pacific/Easter", "America/Punta_Arenas", "America/Santiago"];
|
|
45
|
+
readonly cl: readonly ["America/Coyhaique", "Pacific/Easter", "America/Punta_Arenas", "America/Santiago"];
|
|
46
46
|
readonly cm: readonly ["Africa/Douala"];
|
|
47
47
|
readonly cn: readonly ["Asia/Shanghai", "Asia/Shanghai", "Asia/Urumqi", "Asia/Shanghai", "Asia/Urumqi"];
|
|
48
48
|
readonly co: readonly ["America/Bogota"];
|
package/timezones.generated.js
CHANGED
|
@@ -29,7 +29,7 @@ export var timezones = {
|
|
|
29
29
|
"Africa/Luanda"
|
|
30
30
|
],
|
|
31
31
|
"aq": [
|
|
32
|
-
"
|
|
32
|
+
"Antarctica/McMurdo",
|
|
33
33
|
"Antarctica/Casey",
|
|
34
34
|
"Antarctica/Davis",
|
|
35
35
|
"Antarctica/DumontDUrville",
|
|
@@ -208,6 +208,7 @@ export var timezones = {
|
|
|
208
208
|
"Pacific/Rarotonga"
|
|
209
209
|
],
|
|
210
210
|
"cl": [
|
|
211
|
+
"America/Coyhaique",
|
|
211
212
|
"Pacific/Easter",
|
|
212
213
|
"America/Punta_Arenas",
|
|
213
214
|
"America/Santiago"
|
package/week-data.generated.d.ts
CHANGED
|
@@ -575,7 +575,7 @@ export declare const weekData: {
|
|
|
575
575
|
readonly weekend: readonly [5];
|
|
576
576
|
};
|
|
577
577
|
readonly IS: {
|
|
578
|
-
readonly firstDay:
|
|
578
|
+
readonly firstDay: 7;
|
|
579
579
|
readonly minimalDays: 4;
|
|
580
580
|
readonly weekend: readonly [6, 7];
|
|
581
581
|
};
|
|
@@ -1296,4 +1296,4 @@ export declare const weekData: {
|
|
|
1296
1296
|
};
|
|
1297
1297
|
};
|
|
1298
1298
|
export type WeekDataKey = keyof typeof weekData;
|
|
1299
|
-
export type WeekInfoInternal = typeof weekData[WeekDataKey];
|
|
1299
|
+
export type WeekInfoInternal = (typeof weekData)[WeekDataKey];
|