@bereasoftware/time-guard 2.2.0 → 2.2.3
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/dist/bereasoftware-time-guard-2.2.3.tgz +0 -0
- package/dist/calendars/index.es.js +1 -1
- package/dist/locales/index.es.js +1 -1
- package/dist/plugins/advanced-format.es.js +1 -1
- package/dist/plugins/duration.es.js +1 -1
- package/dist/plugins/relative-time.es.js +1 -1
- package/dist/time-guard.cjs +1 -1
- package/dist/time-guard.es.js +128 -128
- package/dist/time-guard.iife.js +1 -1
- package/dist/time-guard.umd.js +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/time-guard.d.ts +1 -1
- package/package.json +10 -12
package/dist/time-guard.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! time-guard v2.2.
|
|
1
|
+
/*! time-guard v2.2.2 | (c) 2026 Berea-Soft | MIT License | https://github.com/Berea-Soft/time-guard */
|
|
2
2
|
import "@js-temporal/polyfill";
|
|
3
3
|
//#region src/adapters/temporal.adapter.ts
|
|
4
4
|
var e = null;
|
|
@@ -313,7 +313,47 @@ var n = class {
|
|
|
313
313
|
let r = this.getPreset(t);
|
|
314
314
|
return this.format(e, r, n);
|
|
315
315
|
}
|
|
316
|
-
}, s = class {
|
|
316
|
+
}, s = class e {
|
|
317
|
+
static instance;
|
|
318
|
+
plugins = /* @__PURE__ */ new Map();
|
|
319
|
+
static getInstance() {
|
|
320
|
+
return e.instance ||= new e(), e.instance;
|
|
321
|
+
}
|
|
322
|
+
static use(t, n, r) {
|
|
323
|
+
e.getInstance().register(t, n, r);
|
|
324
|
+
}
|
|
325
|
+
static useMultiple(t, n, r) {
|
|
326
|
+
let i = e.getInstance();
|
|
327
|
+
t.forEach((e) => i.register(e, n, r));
|
|
328
|
+
}
|
|
329
|
+
static getPlugin(t) {
|
|
330
|
+
return e.getInstance().plugins.get(t);
|
|
331
|
+
}
|
|
332
|
+
static hasPlugin(t) {
|
|
333
|
+
return e.getInstance().plugins.has(t);
|
|
334
|
+
}
|
|
335
|
+
static listPlugins() {
|
|
336
|
+
let t = e.getInstance();
|
|
337
|
+
return Array.from(t.plugins.keys());
|
|
338
|
+
}
|
|
339
|
+
static unuse(t) {
|
|
340
|
+
return e.getInstance().plugins.delete(t);
|
|
341
|
+
}
|
|
342
|
+
static clear() {
|
|
343
|
+
e.getInstance().plugins.clear();
|
|
344
|
+
}
|
|
345
|
+
register(e, t, n) {
|
|
346
|
+
if (this.plugins.has(e.name)) {
|
|
347
|
+
console.warn(`Plugin "${e.name}" is already registered. Skipping...`);
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
try {
|
|
351
|
+
e.install(t, n), this.plugins.set(e.name, e), console.debug(`Plugin "${e.name}" v${e.version} registered successfully`);
|
|
352
|
+
} catch (t) {
|
|
353
|
+
throw console.error(`Failed to register plugin "${e.name}":`, t), Error(`Failed to register plugin "${e.name}": ${t instanceof Error ? t.message : String(t)}`);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}, c = class {
|
|
317
357
|
_value;
|
|
318
358
|
_tg1;
|
|
319
359
|
_tg2;
|
|
@@ -385,7 +425,7 @@ var n = class {
|
|
|
385
425
|
toJSON() {
|
|
386
426
|
return this._value;
|
|
387
427
|
}
|
|
388
|
-
},
|
|
428
|
+
}, l = class {
|
|
389
429
|
years;
|
|
390
430
|
months;
|
|
391
431
|
weeks;
|
|
@@ -608,14 +648,14 @@ var n = class {
|
|
|
608
648
|
};
|
|
609
649
|
return ((r[n] || r.en)[e] || [e, e + "s"])[t === 1 ? 0 : 1];
|
|
610
650
|
}
|
|
611
|
-
},
|
|
651
|
+
}, u = class {
|
|
612
652
|
_start;
|
|
613
653
|
_end;
|
|
614
654
|
constructor(e, t) {
|
|
615
655
|
this._start = e, this._end = t;
|
|
616
656
|
}
|
|
617
657
|
toDuration() {
|
|
618
|
-
return
|
|
658
|
+
return d.between(this._start, this._end);
|
|
619
659
|
}
|
|
620
660
|
inMonths() {
|
|
621
661
|
return this.toDuration().total("month");
|
|
@@ -626,7 +666,7 @@ var n = class {
|
|
|
626
666
|
in(e) {
|
|
627
667
|
return this.toDuration().total(e);
|
|
628
668
|
}
|
|
629
|
-
},
|
|
669
|
+
}, d = class e {
|
|
630
670
|
temporal;
|
|
631
671
|
config;
|
|
632
672
|
formatterInstance;
|
|
@@ -679,7 +719,7 @@ var n = class {
|
|
|
679
719
|
return a.until(o);
|
|
680
720
|
}
|
|
681
721
|
static range(t, n) {
|
|
682
|
-
return new
|
|
722
|
+
return new u(t instanceof e ? t : new e(t), n instanceof e ? n : new e(n));
|
|
683
723
|
}
|
|
684
724
|
toTemporal() {
|
|
685
725
|
return this.temporal;
|
|
@@ -772,16 +812,16 @@ var n = class {
|
|
|
772
812
|
let e = t, n = a[e], o = r.since(i, { smallestUnit: e });
|
|
773
813
|
return Math.round(o[n] || 0);
|
|
774
814
|
}
|
|
775
|
-
let o = t || {},
|
|
776
|
-
if (
|
|
815
|
+
let o = t || {}, s = o.mode || "exact", l = o.unit || "millisecond", u = o.locale || this.config.locale;
|
|
816
|
+
if (s === "exact") {
|
|
777
817
|
let n = a[l], o = r.since(i, { smallestUnit: l }), d = Math.round(o[n] || 0);
|
|
778
818
|
if (t === void 0 || typeof t == "object") {
|
|
779
819
|
let t = (o.years || 0) * 365.25 * 24 * 60 * 60 * 1e3 + (o.months || 0) * 30.44 * 24 * 60 * 60 * 1e3 + (o.weeks || 0) * 7 * 24 * 60 * 60 * 1e3 + (o.days || 0) * 24 * 60 * 60 * 1e3 + (o.hours || 0) * 60 * 60 * 1e3 + (o.minutes || 0) * 60 * 1e3 + (o.seconds || 0) * 1e3 + (o.milliseconds || 0);
|
|
780
|
-
return new
|
|
820
|
+
return new c(Math.round(t), this, e, s, void 0, u);
|
|
781
821
|
}
|
|
782
822
|
return d;
|
|
783
823
|
}
|
|
784
|
-
if (
|
|
824
|
+
if (s === "calendar") {
|
|
785
825
|
let t = r.since(i, {
|
|
786
826
|
largestUnit: "month",
|
|
787
827
|
smallestUnit: "millisecond"
|
|
@@ -795,10 +835,10 @@ var n = class {
|
|
|
795
835
|
seconds: Math.floor(t.seconds || 0),
|
|
796
836
|
milliseconds: Math.floor(t.milliseconds || 0)
|
|
797
837
|
}, a = (t.years || 0) * 365.25 * 24 * 60 * 60 * 1e3 + (t.months || 0) * 30.44 * 24 * 60 * 60 * 1e3 + (t.weeks || 0) * 7 * 24 * 60 * 60 * 1e3 + (t.days || 0) * 24 * 60 * 60 * 1e3 + (t.hours || 0) * 60 * 60 * 1e3 + (t.minutes || 0) * 60 * 1e3 + (t.seconds || 0) * 1e3 + (t.milliseconds || 0);
|
|
798
|
-
return new
|
|
838
|
+
return new c(Math.round(a), this, e, s, n, u);
|
|
799
839
|
}
|
|
800
840
|
let d = r.since(i, { smallestUnit: "millisecond" }), f = (d.years || 0) * 365.25 * 24 * 60 * 60 * 1e3 + (d.months || 0) * 30.44 * 24 * 60 * 60 * 1e3 + (d.weeks || 0) * 7 * 24 * 60 * 60 * 1e3 + (d.days || 0) * 24 * 60 * 60 * 1e3 + (d.hours || 0) * 60 * 60 * 1e3 + (d.minutes || 0) * 60 * 1e3 + (d.seconds || 0) * 1e3 + (d.milliseconds || 0);
|
|
801
|
-
return new
|
|
841
|
+
return new c(Math.round(f), this, e, s, void 0, u);
|
|
802
842
|
}
|
|
803
843
|
isBefore(e) {
|
|
804
844
|
let t = n.toPlainDateTime(this.temporal), r = n.toPlainDateTime(e.temporal);
|
|
@@ -912,8 +952,8 @@ var n = class {
|
|
|
912
952
|
try {
|
|
913
953
|
let t = {};
|
|
914
954
|
r?.largestUnit && (t.largestUnit = r.largestUnit), r?.smallestUnit && (t.smallestUnit = r.smallestUnit);
|
|
915
|
-
let n = a.since(i, Object.keys(t).length > 0 ? t : void 0), s = e.toDurationParts(n),
|
|
916
|
-
for (let t =
|
|
955
|
+
let n = a.since(i, Object.keys(t).length > 0 ? t : void 0), s = e.toDurationParts(n), c = i.year, u = a.year, d = [];
|
|
956
|
+
for (let t = c; t <= u; t++) {
|
|
917
957
|
let n = e.isLeapYearValue(t);
|
|
918
958
|
d.push({
|
|
919
959
|
year: t,
|
|
@@ -922,7 +962,7 @@ var n = class {
|
|
|
922
962
|
});
|
|
923
963
|
}
|
|
924
964
|
let f = this.generateUntilSteps(i, a, s, d), p = performance.now() - o;
|
|
925
|
-
return new
|
|
965
|
+
return new l(s, this.config.locale, {
|
|
926
966
|
startDate: i.toString(),
|
|
927
967
|
endDate: a.toString(),
|
|
928
968
|
steps: f,
|
|
@@ -931,7 +971,7 @@ var n = class {
|
|
|
931
971
|
calculationTimeMs: p
|
|
932
972
|
});
|
|
933
973
|
} catch {
|
|
934
|
-
return new
|
|
974
|
+
return new l(e.ZERO_DURATION, this.config.locale, {
|
|
935
975
|
startDate: i.toString(),
|
|
936
976
|
endDate: a.toString(),
|
|
937
977
|
steps: ["Calculation failed, returning zero duration"],
|
|
@@ -1049,8 +1089,8 @@ var n = class {
|
|
|
1049
1089
|
try {
|
|
1050
1090
|
let t = {};
|
|
1051
1091
|
r?.largestUnit && (t.largestUnit = r.largestUnit), r?.smallestUnit && (t.smallestUnit = r.smallestUnit);
|
|
1052
|
-
let n = i.since(a, Object.keys(t).length > 0 ? t : void 0), s = e.toDurationParts(n),
|
|
1053
|
-
for (let t =
|
|
1092
|
+
let n = i.since(a, Object.keys(t).length > 0 ? t : void 0), s = e.toDurationParts(n), c = a.year, u = i.year, d = [];
|
|
1093
|
+
for (let t = c; t <= u; t++) {
|
|
1054
1094
|
let n = e.isLeapYearValue(t);
|
|
1055
1095
|
d.push({
|
|
1056
1096
|
year: t,
|
|
@@ -1059,7 +1099,7 @@ var n = class {
|
|
|
1059
1099
|
});
|
|
1060
1100
|
}
|
|
1061
1101
|
let f = this.generateUntilSteps(a, i, s, d), p = performance.now() - o;
|
|
1062
|
-
return new
|
|
1102
|
+
return new l(s, this.config.locale, {
|
|
1063
1103
|
startDate: a.toString(),
|
|
1064
1104
|
endDate: i.toString(),
|
|
1065
1105
|
steps: f,
|
|
@@ -1068,7 +1108,7 @@ var n = class {
|
|
|
1068
1108
|
calculationTimeMs: p
|
|
1069
1109
|
});
|
|
1070
1110
|
} catch {
|
|
1071
|
-
return new
|
|
1111
|
+
return new l(e.ZERO_DURATION, this.config.locale, {
|
|
1072
1112
|
startDate: a.toString(),
|
|
1073
1113
|
endDate: i.toString(),
|
|
1074
1114
|
steps: ["Calculation failed, returning zero duration"],
|
|
@@ -1099,7 +1139,7 @@ var n = class {
|
|
|
1099
1139
|
isYesterday() {
|
|
1100
1140
|
return this.isSame(e.now().subtract({ day: 1 }), "day");
|
|
1101
1141
|
}
|
|
1102
|
-
},
|
|
1142
|
+
}, f = {
|
|
1103
1143
|
name: "en",
|
|
1104
1144
|
months: [
|
|
1105
1145
|
"January",
|
|
@@ -1167,7 +1207,7 @@ var n = class {
|
|
|
1167
1207
|
datetime: "YYYY-MM-DD HH:mm:ss",
|
|
1168
1208
|
rfc2822: "ddd, DD MMM YYYY HH:mm:ss Z"
|
|
1169
1209
|
}
|
|
1170
|
-
},
|
|
1210
|
+
}, p = {
|
|
1171
1211
|
name: "en-au",
|
|
1172
1212
|
months: [
|
|
1173
1213
|
"January",
|
|
@@ -1235,7 +1275,7 @@ var n = class {
|
|
|
1235
1275
|
datetime: "DD/MM/YYYY HH:mm:ss",
|
|
1236
1276
|
rfc2822: "ddd, DD MMM YYYY HH:mm:ss Z"
|
|
1237
1277
|
}
|
|
1238
|
-
},
|
|
1278
|
+
}, m = {
|
|
1239
1279
|
name: "en-gb",
|
|
1240
1280
|
months: [
|
|
1241
1281
|
"January",
|
|
@@ -1303,7 +1343,7 @@ var n = class {
|
|
|
1303
1343
|
datetime: "DD/MM/YYYY HH:mm:ss",
|
|
1304
1344
|
rfc2822: "ddd, DD MMM YYYY HH:mm:ss Z"
|
|
1305
1345
|
}
|
|
1306
|
-
},
|
|
1346
|
+
}, h = {
|
|
1307
1347
|
name: "en-ca",
|
|
1308
1348
|
months: [
|
|
1309
1349
|
"January",
|
|
@@ -1371,12 +1411,12 @@ var n = class {
|
|
|
1371
1411
|
datetime: "YYYY-MM-DD HH:mm:ss",
|
|
1372
1412
|
rfc2822: "ddd, DD MMM YYYY HH:mm:ss Z"
|
|
1373
1413
|
}
|
|
1374
|
-
},
|
|
1375
|
-
en:
|
|
1376
|
-
"en-au":
|
|
1377
|
-
"en-gb":
|
|
1378
|
-
"en-ca":
|
|
1379
|
-
},
|
|
1414
|
+
}, g = {
|
|
1415
|
+
en: f,
|
|
1416
|
+
"en-au": p,
|
|
1417
|
+
"en-gb": m,
|
|
1418
|
+
"en-ca": h
|
|
1419
|
+
}, _ = {
|
|
1380
1420
|
name: "es",
|
|
1381
1421
|
months: [
|
|
1382
1422
|
"Enero",
|
|
@@ -1444,7 +1484,7 @@ var n = class {
|
|
|
1444
1484
|
datetime: "DD/MM/YYYY HH:mm:ss",
|
|
1445
1485
|
rfc2822: "ddd, DD MMM YYYY HH:mm:ss Z"
|
|
1446
1486
|
}
|
|
1447
|
-
},
|
|
1487
|
+
}, v = {
|
|
1448
1488
|
name: "es-mx",
|
|
1449
1489
|
months: [
|
|
1450
1490
|
"Enero",
|
|
@@ -1512,7 +1552,7 @@ var n = class {
|
|
|
1512
1552
|
datetime: "DD/MM/YYYY HH:mm:ss",
|
|
1513
1553
|
rfc2822: "ddd, DD MMM YYYY HH:mm:ss Z"
|
|
1514
1554
|
}
|
|
1515
|
-
},
|
|
1555
|
+
}, y = {
|
|
1516
1556
|
name: "es-us",
|
|
1517
1557
|
months: [
|
|
1518
1558
|
"Enero",
|
|
@@ -1580,10 +1620,10 @@ var n = class {
|
|
|
1580
1620
|
datetime: "MM/DD/YYYY HH:mm:ss",
|
|
1581
1621
|
rfc2822: "ddd, DD MMM YYYY HH:mm:ss Z"
|
|
1582
1622
|
}
|
|
1583
|
-
},
|
|
1584
|
-
es:
|
|
1585
|
-
"es-mx":
|
|
1586
|
-
"es-us":
|
|
1623
|
+
}, ee = {
|
|
1624
|
+
es: _,
|
|
1625
|
+
"es-mx": v,
|
|
1626
|
+
"es-us": y
|
|
1587
1627
|
}, te = {
|
|
1588
1628
|
name: "fr",
|
|
1589
1629
|
months: [
|
|
@@ -1720,7 +1760,7 @@ var n = class {
|
|
|
1720
1760
|
datetime: "DD/MM/YYYY HH:mm:ss",
|
|
1721
1761
|
rfc2822: "ddd, DD MMM YYYY HH:mm:ss Z"
|
|
1722
1762
|
}
|
|
1723
|
-
},
|
|
1763
|
+
}, b = {
|
|
1724
1764
|
name: "pt",
|
|
1725
1765
|
months: [
|
|
1726
1766
|
"janeiro",
|
|
@@ -1788,7 +1828,7 @@ var n = class {
|
|
|
1788
1828
|
datetime: "DD/MM/YYYY HH:mm:ss",
|
|
1789
1829
|
rfc2822: "ddd, DD MMM YYYY HH:mm:ss Z"
|
|
1790
1830
|
}
|
|
1791
|
-
},
|
|
1831
|
+
}, x = {
|
|
1792
1832
|
name: "pt-br",
|
|
1793
1833
|
months: [
|
|
1794
1834
|
"janeiro",
|
|
@@ -1856,7 +1896,7 @@ var n = class {
|
|
|
1856
1896
|
datetime: "DD/MM/YYYY HH:mm:ss",
|
|
1857
1897
|
rfc2822: "ddd, DD MMM YYYY HH:mm:ss Z"
|
|
1858
1898
|
}
|
|
1859
|
-
},
|
|
1899
|
+
}, S = {
|
|
1860
1900
|
name: "ro",
|
|
1861
1901
|
months: [
|
|
1862
1902
|
"ianuarie",
|
|
@@ -1924,13 +1964,13 @@ var n = class {
|
|
|
1924
1964
|
datetime: "DD.MM.YYYY HH:mm:ss",
|
|
1925
1965
|
rfc2822: "ddd, DD MMM YYYY HH:mm:ss Z"
|
|
1926
1966
|
}
|
|
1927
|
-
},
|
|
1967
|
+
}, C = {
|
|
1928
1968
|
fr: te,
|
|
1929
1969
|
it: ne,
|
|
1930
|
-
pt:
|
|
1931
|
-
"pt-br":
|
|
1932
|
-
ro:
|
|
1933
|
-
},
|
|
1970
|
+
pt: b,
|
|
1971
|
+
"pt-br": x,
|
|
1972
|
+
ro: S
|
|
1973
|
+
}, w = {
|
|
1934
1974
|
ru: {
|
|
1935
1975
|
name: "ru",
|
|
1936
1976
|
months: [
|
|
@@ -2207,7 +2247,7 @@ var n = class {
|
|
|
2207
2247
|
rfc2822: "ddd, DD MMM YYYY HH:mm:ss Z"
|
|
2208
2248
|
}
|
|
2209
2249
|
}
|
|
2210
|
-
},
|
|
2250
|
+
}, T = {
|
|
2211
2251
|
sv: {
|
|
2212
2252
|
name: "sv",
|
|
2213
2253
|
months: [
|
|
@@ -2484,7 +2524,7 @@ var n = class {
|
|
|
2484
2524
|
rfc2822: "ddd, DD MMM YYYY HH:mm:ss Z"
|
|
2485
2525
|
}
|
|
2486
2526
|
}
|
|
2487
|
-
},
|
|
2527
|
+
}, E = {
|
|
2488
2528
|
name: "ja",
|
|
2489
2529
|
months: [
|
|
2490
2530
|
"1月",
|
|
@@ -2552,7 +2592,7 @@ var n = class {
|
|
|
2552
2592
|
datetime: "YYYY年MM月DD日 HH:mm:ss",
|
|
2553
2593
|
rfc2822: "ddd, DD MMM YYYY HH:mm:ss Z"
|
|
2554
2594
|
}
|
|
2555
|
-
},
|
|
2595
|
+
}, D = {
|
|
2556
2596
|
name: "zh-cn",
|
|
2557
2597
|
months: [
|
|
2558
2598
|
"1月",
|
|
@@ -2620,7 +2660,7 @@ var n = class {
|
|
|
2620
2660
|
datetime: "YYYY-MM-DD HH:mm:ss",
|
|
2621
2661
|
rfc2822: "ddd, DD MMM YYYY HH:mm:ss Z"
|
|
2622
2662
|
}
|
|
2623
|
-
},
|
|
2663
|
+
}, O = {
|
|
2624
2664
|
name: "zh-tw",
|
|
2625
2665
|
months: [
|
|
2626
2666
|
"1月",
|
|
@@ -2688,7 +2728,7 @@ var n = class {
|
|
|
2688
2728
|
datetime: "YYYY-MM-DD HH:mm:ss",
|
|
2689
2729
|
rfc2822: "ddd, DD MMM YYYY HH:mm:ss Z"
|
|
2690
2730
|
}
|
|
2691
|
-
},
|
|
2731
|
+
}, k = {
|
|
2692
2732
|
name: "ko",
|
|
2693
2733
|
months: [
|
|
2694
2734
|
"1월",
|
|
@@ -2756,7 +2796,7 @@ var n = class {
|
|
|
2756
2796
|
datetime: "YYYY-MM-DD HH:mm:ss",
|
|
2757
2797
|
rfc2822: "ddd, DD MMM YYYY HH:mm:ss Z"
|
|
2758
2798
|
}
|
|
2759
|
-
},
|
|
2799
|
+
}, A = {
|
|
2760
2800
|
name: "th",
|
|
2761
2801
|
months: [
|
|
2762
2802
|
"มกราคม",
|
|
@@ -2824,7 +2864,7 @@ var n = class {
|
|
|
2824
2864
|
datetime: "DD/MM/YYYY HH:mm:ss",
|
|
2825
2865
|
rfc2822: "ddd, DD MMM YYYY HH:mm:ss Z"
|
|
2826
2866
|
}
|
|
2827
|
-
},
|
|
2867
|
+
}, j = {
|
|
2828
2868
|
name: "vi",
|
|
2829
2869
|
months: [
|
|
2830
2870
|
"tháng 1",
|
|
@@ -2892,7 +2932,7 @@ var n = class {
|
|
|
2892
2932
|
datetime: "DD/MM/YYYY HH:mm:ss",
|
|
2893
2933
|
rfc2822: "ddd, DD MMM YYYY HH:mm:ss Z"
|
|
2894
2934
|
}
|
|
2895
|
-
},
|
|
2935
|
+
}, M = {
|
|
2896
2936
|
name: "id",
|
|
2897
2937
|
months: [
|
|
2898
2938
|
"Januari",
|
|
@@ -2960,15 +3000,15 @@ var n = class {
|
|
|
2960
3000
|
datetime: "DD/MM/YYYY HH:mm:ss",
|
|
2961
3001
|
rfc2822: "ddd, DD MMM YYYY HH:mm:ss Z"
|
|
2962
3002
|
}
|
|
2963
|
-
},
|
|
2964
|
-
ja:
|
|
2965
|
-
"zh-cn":
|
|
2966
|
-
"zh-tw":
|
|
2967
|
-
ko:
|
|
2968
|
-
th:
|
|
2969
|
-
vi:
|
|
2970
|
-
id:
|
|
2971
|
-
},
|
|
3003
|
+
}, N = {
|
|
3004
|
+
ja: E,
|
|
3005
|
+
"zh-cn": D,
|
|
3006
|
+
"zh-tw": O,
|
|
3007
|
+
ko: k,
|
|
3008
|
+
th: A,
|
|
3009
|
+
vi: j,
|
|
3010
|
+
id: M
|
|
3011
|
+
}, P = {
|
|
2972
3012
|
de: {
|
|
2973
3013
|
name: "de",
|
|
2974
3014
|
months: [
|
|
@@ -3452,7 +3492,7 @@ var n = class {
|
|
|
3452
3492
|
rfc2822: "ddd, DD MMM YYYY HH:mm:ss Z"
|
|
3453
3493
|
}
|
|
3454
3494
|
}
|
|
3455
|
-
},
|
|
3495
|
+
}, F = {
|
|
3456
3496
|
ar: {
|
|
3457
3497
|
name: "ar",
|
|
3458
3498
|
months: [
|
|
@@ -3660,7 +3700,7 @@ var n = class {
|
|
|
3660
3700
|
rfc2822: "ddd, DD MMM YYYY HH:mm:ss Z"
|
|
3661
3701
|
}
|
|
3662
3702
|
}
|
|
3663
|
-
},
|
|
3703
|
+
}, I = {
|
|
3664
3704
|
vi: {
|
|
3665
3705
|
name: "vi",
|
|
3666
3706
|
months: [
|
|
@@ -3868,30 +3908,30 @@ var n = class {
|
|
|
3868
3908
|
rfc2822: "ddd, DD MMM YYYY HH:mm:ss Z"
|
|
3869
3909
|
}
|
|
3870
3910
|
}
|
|
3871
|
-
},
|
|
3911
|
+
}, L = {
|
|
3912
|
+
...g,
|
|
3872
3913
|
...ee,
|
|
3873
|
-
...v,
|
|
3874
|
-
...x,
|
|
3875
|
-
...S,
|
|
3876
3914
|
...C,
|
|
3877
|
-
...
|
|
3878
|
-
...
|
|
3915
|
+
...w,
|
|
3916
|
+
...T,
|
|
3879
3917
|
...N,
|
|
3880
|
-
...P
|
|
3918
|
+
...P,
|
|
3919
|
+
...F,
|
|
3920
|
+
...I
|
|
3881
3921
|
};
|
|
3882
|
-
function
|
|
3883
|
-
e instanceof Map ? Object.entries(
|
|
3922
|
+
function R(e) {
|
|
3923
|
+
e instanceof Map ? Object.entries(L).forEach(([t, n]) => {
|
|
3884
3924
|
e.set(t, n);
|
|
3885
|
-
}) : Object.entries(
|
|
3925
|
+
}) : Object.entries(L).forEach(([t, n]) => {
|
|
3886
3926
|
e[t] = n;
|
|
3887
3927
|
});
|
|
3888
3928
|
}
|
|
3889
|
-
function
|
|
3890
|
-
let e = Object.keys(
|
|
3929
|
+
function z() {
|
|
3930
|
+
let e = Object.keys(L);
|
|
3891
3931
|
for (; e.length < 40;) e.push(`locale-${e.length + 1}`);
|
|
3892
3932
|
return e;
|
|
3893
3933
|
}
|
|
3894
|
-
var
|
|
3934
|
+
var re = 40, B = class {
|
|
3895
3935
|
id = "gregory";
|
|
3896
3936
|
name = "Gregorian Calendar";
|
|
3897
3937
|
locale = "en";
|
|
@@ -3969,12 +4009,12 @@ var R = 40, z = class {
|
|
|
3969
4009
|
daysInYear(e) {
|
|
3970
4010
|
return this.isLeapYear(e) ? 366 : 365;
|
|
3971
4011
|
}
|
|
3972
|
-
},
|
|
4012
|
+
}, V = class e {
|
|
3973
4013
|
static instance;
|
|
3974
4014
|
calendars = /* @__PURE__ */ new Map();
|
|
3975
4015
|
defaultCalendar = "gregory";
|
|
3976
4016
|
constructor() {
|
|
3977
|
-
this.register(new
|
|
4017
|
+
this.register(new B());
|
|
3978
4018
|
}
|
|
3979
4019
|
static getInstance() {
|
|
3980
4020
|
return e.instance ||= new e(), e.instance;
|
|
@@ -3996,7 +4036,7 @@ var R = 40, z = class {
|
|
|
3996
4036
|
if (!e) throw Error(`Default calendar '${this.defaultCalendar}' not found`);
|
|
3997
4037
|
return e;
|
|
3998
4038
|
}
|
|
3999
|
-
},
|
|
4039
|
+
}, H = V.getInstance(), U = class {
|
|
4000
4040
|
id = "islamic";
|
|
4001
4041
|
name = "Islamic Calendar (Hijri)";
|
|
4002
4042
|
locale = "ar";
|
|
@@ -4057,7 +4097,7 @@ var R = 40, z = class {
|
|
|
4057
4097
|
daysInYear(e) {
|
|
4058
4098
|
return this.isLeapYear(e) ? 355 : 354;
|
|
4059
4099
|
}
|
|
4060
|
-
},
|
|
4100
|
+
}, W = class {
|
|
4061
4101
|
id = "hebrew";
|
|
4062
4102
|
name = "Hebrew Calendar";
|
|
4063
4103
|
locale = "he";
|
|
@@ -4127,7 +4167,7 @@ var R = 40, z = class {
|
|
|
4127
4167
|
daysInYear(e) {
|
|
4128
4168
|
return this.isLeapYear(e) ? 384 : 354;
|
|
4129
4169
|
}
|
|
4130
|
-
},
|
|
4170
|
+
}, G = class {
|
|
4131
4171
|
id = "chinese";
|
|
4132
4172
|
name = "Chinese Calendar";
|
|
4133
4173
|
locale = "zh";
|
|
@@ -4193,7 +4233,7 @@ var R = 40, z = class {
|
|
|
4193
4233
|
getZodiacSign(e) {
|
|
4194
4234
|
return this.terrestrialBranches[e % 12];
|
|
4195
4235
|
}
|
|
4196
|
-
},
|
|
4236
|
+
}, K = class {
|
|
4197
4237
|
id = "japanese";
|
|
4198
4238
|
name = "Japanese Calendar";
|
|
4199
4239
|
locale = "ja";
|
|
@@ -4255,7 +4295,7 @@ var R = 40, z = class {
|
|
|
4255
4295
|
daysInYear(e) {
|
|
4256
4296
|
return this.isLeapYear(e) ? 366 : 365;
|
|
4257
4297
|
}
|
|
4258
|
-
},
|
|
4298
|
+
}, q = class {
|
|
4259
4299
|
id = "buddhist";
|
|
4260
4300
|
name = "Buddhist Calendar";
|
|
4261
4301
|
locale = "th";
|
|
@@ -4310,46 +4350,6 @@ var R = 40, z = class {
|
|
|
4310
4350
|
daysInYear(e) {
|
|
4311
4351
|
return this.isLeapYear(e) ? 366 : 365;
|
|
4312
4352
|
}
|
|
4313
|
-
}, q = class e {
|
|
4314
|
-
static instance;
|
|
4315
|
-
plugins = /* @__PURE__ */ new Map();
|
|
4316
|
-
static getInstance() {
|
|
4317
|
-
return e.instance ||= new e(), e.instance;
|
|
4318
|
-
}
|
|
4319
|
-
static use(t, n, r) {
|
|
4320
|
-
e.getInstance().register(t, n, r);
|
|
4321
|
-
}
|
|
4322
|
-
static useMultiple(t, n, r) {
|
|
4323
|
-
let i = e.getInstance();
|
|
4324
|
-
t.forEach((e) => i.register(e, n, r));
|
|
4325
|
-
}
|
|
4326
|
-
static getPlugin(t) {
|
|
4327
|
-
return e.getInstance().plugins.get(t);
|
|
4328
|
-
}
|
|
4329
|
-
static hasPlugin(t) {
|
|
4330
|
-
return e.getInstance().plugins.has(t);
|
|
4331
|
-
}
|
|
4332
|
-
static listPlugins() {
|
|
4333
|
-
let t = e.getInstance();
|
|
4334
|
-
return Array.from(t.plugins.keys());
|
|
4335
|
-
}
|
|
4336
|
-
static unuse(t) {
|
|
4337
|
-
return e.getInstance().plugins.delete(t);
|
|
4338
|
-
}
|
|
4339
|
-
static clear() {
|
|
4340
|
-
e.getInstance().plugins.clear();
|
|
4341
|
-
}
|
|
4342
|
-
register(e, t, n) {
|
|
4343
|
-
if (this.plugins.has(e.name)) {
|
|
4344
|
-
console.warn(`Plugin "${e.name}" is already registered. Skipping...`);
|
|
4345
|
-
return;
|
|
4346
|
-
}
|
|
4347
|
-
try {
|
|
4348
|
-
e.install(t, n), this.plugins.set(e.name, e), console.debug(`Plugin "${e.name}" v${e.version} registered successfully`);
|
|
4349
|
-
} catch (t) {
|
|
4350
|
-
throw console.error(`Failed to register plugin "${e.name}":`, t), Error(`Failed to register plugin "${e.name}": ${t instanceof Error ? t.message : String(t)}`);
|
|
4351
|
-
}
|
|
4352
|
-
}
|
|
4353
4353
|
}, J = [
|
|
4354
4354
|
{
|
|
4355
4355
|
l: "s",
|
|
@@ -4738,9 +4738,9 @@ var R = 40, z = class {
|
|
|
4738
4738
|
//#endregion
|
|
4739
4739
|
//#region src/index.ts
|
|
4740
4740
|
function se(e, t) {
|
|
4741
|
-
return new
|
|
4741
|
+
return new d(e, t);
|
|
4742
4742
|
}
|
|
4743
|
-
var ce = "2.2.
|
|
4744
|
-
a.getInstance().loadLocales(
|
|
4743
|
+
var ce = "2.2.2";
|
|
4744
|
+
a.getInstance().loadLocales(L);
|
|
4745
4745
|
//#endregion
|
|
4746
|
-
export {
|
|
4746
|
+
export { L as ALL_LOCALES, $ as AdvancedFormatPlugin, q as BuddhistCalendar, V as CalendarManager, G as ChineseCalendar, o as DateFormatter, Z as Duration, Q as DurationPlugin, l as DurationResult, r as EN_LOCALE, i as ES_LOCALE, B as GregorianCalendar, W as HebrewCalendar, U as IslamicCalendar, K as JapaneseCalendar, re as LOCALES_COUNT, a as LocaleManager, s as PluginManager, X as RelativeTimePlugin, n as TemporalAdapter, d as TimeGuard, u as TimeRange, oe as advancedFormatPlugin, H as calendarManager, ae as durationPlugin, z as getAvailableLocales, R as registerAllLocales, ie as relativeTimePlugin, se as timeGuard, ce as version };
|