@internationalized/date 3.5.4-nightly.4624 → 3.5.4
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/BuddhistCalendar.main.js +2 -2
- package/dist/BuddhistCalendar.mjs +2 -2
- package/dist/BuddhistCalendar.module.js +2 -2
- package/dist/CalendarDate.main.js +6 -6
- package/dist/CalendarDate.mjs +6 -6
- package/dist/CalendarDate.module.js +6 -6
- package/dist/DateFormatter.main.js +30 -30
- package/dist/DateFormatter.mjs +30 -30
- package/dist/DateFormatter.module.js +30 -30
- package/dist/EthiopicCalendar.main.js +20 -20
- package/dist/EthiopicCalendar.mjs +20 -20
- package/dist/EthiopicCalendar.module.js +20 -20
- package/dist/GregorianCalendar.main.js +9 -9
- package/dist/GregorianCalendar.mjs +9 -9
- package/dist/GregorianCalendar.module.js +9 -9
- package/dist/HebrewCalendar.main.js +2 -2
- package/dist/HebrewCalendar.mjs +2 -2
- package/dist/HebrewCalendar.module.js +2 -2
- package/dist/IndianCalendar.main.js +2 -2
- package/dist/IndianCalendar.mjs +2 -2
- package/dist/IndianCalendar.module.js +2 -2
- package/dist/IslamicCalendar.main.js +5 -5
- package/dist/IslamicCalendar.mjs +5 -5
- package/dist/IslamicCalendar.module.js +5 -5
- package/dist/JapaneseCalendar.main.js +7 -7
- package/dist/JapaneseCalendar.mjs +7 -7
- package/dist/JapaneseCalendar.module.js +7 -7
- package/dist/PersianCalendar.main.js +2 -2
- package/dist/PersianCalendar.mjs +2 -2
- package/dist/PersianCalendar.module.js +2 -2
- package/dist/TaiwanCalendar.main.js +8 -8
- package/dist/TaiwanCalendar.mjs +8 -8
- package/dist/TaiwanCalendar.module.js +8 -8
- package/dist/conversion.main.js +28 -28
- package/dist/conversion.mjs +28 -28
- package/dist/conversion.module.js +28 -28
- package/dist/createCalendar.main.js +13 -13
- package/dist/createCalendar.mjs +13 -13
- package/dist/createCalendar.module.js +13 -13
- package/dist/manipulation.main.js +26 -26
- package/dist/manipulation.mjs +26 -26
- package/dist/manipulation.module.js +26 -26
- package/dist/queries.main.js +2 -2
- package/dist/queries.mjs +2 -2
- package/dist/queries.module.js +2 -2
- package/dist/string.main.js +19 -19
- package/dist/string.mjs +19 -19
- package/dist/string.module.js +19 -19
- package/dist/weekStartData.main.js +1 -1
- package/dist/weekStartData.mjs +1 -1
- package/dist/weekStartData.module.js +1 -1
- package/package.json +2 -2
package/dist/IslamicCalendar.mjs
CHANGED
|
@@ -54,11 +54,11 @@ class $f2f3e0e3a817edbd$export$2066795aadd37bfc {
|
|
|
54
54
|
}
|
|
55
55
|
getEras() {
|
|
56
56
|
return [
|
|
57
|
-
|
|
57
|
+
'AH'
|
|
58
58
|
];
|
|
59
59
|
}
|
|
60
60
|
constructor(){
|
|
61
|
-
this.identifier =
|
|
61
|
+
this.identifier = 'islamic-civil';
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
class $f2f3e0e3a817edbd$export$37f0887f2f9d22f7 extends $f2f3e0e3a817edbd$export$2066795aadd37bfc {
|
|
@@ -70,11 +70,11 @@ class $f2f3e0e3a817edbd$export$37f0887f2f9d22f7 extends $f2f3e0e3a817edbd$export
|
|
|
70
70
|
}
|
|
71
71
|
constructor(...args){
|
|
72
72
|
super(...args);
|
|
73
|
-
this.identifier =
|
|
73
|
+
this.identifier = 'islamic-tbla';
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
// Generated by scripts/generate-umalqura.js
|
|
77
|
-
const $f2f3e0e3a817edbd$var$UMALQURA_DATA =
|
|
77
|
+
const $f2f3e0e3a817edbd$var$UMALQURA_DATA = 'qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI=';
|
|
78
78
|
let $f2f3e0e3a817edbd$var$UMALQURA_MONTHLENGTH;
|
|
79
79
|
let $f2f3e0e3a817edbd$var$UMALQURA_YEAR_START_TABLE;
|
|
80
80
|
function $f2f3e0e3a817edbd$var$umalquraYearStart(year) {
|
|
@@ -139,7 +139,7 @@ class $f2f3e0e3a817edbd$export$5baab4758c231076 extends $f2f3e0e3a817edbd$export
|
|
|
139
139
|
}
|
|
140
140
|
constructor(){
|
|
141
141
|
super();
|
|
142
|
-
this.identifier =
|
|
142
|
+
this.identifier = 'islamic-umalqura';
|
|
143
143
|
if (!$f2f3e0e3a817edbd$var$UMALQURA_MONTHLENGTH) $f2f3e0e3a817edbd$var$UMALQURA_MONTHLENGTH = new Uint16Array(Uint8Array.from(atob($f2f3e0e3a817edbd$var$UMALQURA_DATA), (c)=>c.charCodeAt(0)).buffer);
|
|
144
144
|
if (!$f2f3e0e3a817edbd$var$UMALQURA_YEAR_START_TABLE) {
|
|
145
145
|
$f2f3e0e3a817edbd$var$UMALQURA_YEAR_START_TABLE = new Uint32Array($f2f3e0e3a817edbd$var$UMALQURA_YEAR_END - $f2f3e0e3a817edbd$var$UMALQURA_YEAR_START + 1);
|
|
@@ -54,11 +54,11 @@ class $f2f3e0e3a817edbd$export$2066795aadd37bfc {
|
|
|
54
54
|
}
|
|
55
55
|
getEras() {
|
|
56
56
|
return [
|
|
57
|
-
|
|
57
|
+
'AH'
|
|
58
58
|
];
|
|
59
59
|
}
|
|
60
60
|
constructor(){
|
|
61
|
-
this.identifier =
|
|
61
|
+
this.identifier = 'islamic-civil';
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
class $f2f3e0e3a817edbd$export$37f0887f2f9d22f7 extends $f2f3e0e3a817edbd$export$2066795aadd37bfc {
|
|
@@ -70,11 +70,11 @@ class $f2f3e0e3a817edbd$export$37f0887f2f9d22f7 extends $f2f3e0e3a817edbd$export
|
|
|
70
70
|
}
|
|
71
71
|
constructor(...args){
|
|
72
72
|
super(...args);
|
|
73
|
-
this.identifier =
|
|
73
|
+
this.identifier = 'islamic-tbla';
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
// Generated by scripts/generate-umalqura.js
|
|
77
|
-
const $f2f3e0e3a817edbd$var$UMALQURA_DATA =
|
|
77
|
+
const $f2f3e0e3a817edbd$var$UMALQURA_DATA = 'qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI=';
|
|
78
78
|
let $f2f3e0e3a817edbd$var$UMALQURA_MONTHLENGTH;
|
|
79
79
|
let $f2f3e0e3a817edbd$var$UMALQURA_YEAR_START_TABLE;
|
|
80
80
|
function $f2f3e0e3a817edbd$var$umalquraYearStart(year) {
|
|
@@ -139,7 +139,7 @@ class $f2f3e0e3a817edbd$export$5baab4758c231076 extends $f2f3e0e3a817edbd$export
|
|
|
139
139
|
}
|
|
140
140
|
constructor(){
|
|
141
141
|
super();
|
|
142
|
-
this.identifier =
|
|
142
|
+
this.identifier = 'islamic-umalqura';
|
|
143
143
|
if (!$f2f3e0e3a817edbd$var$UMALQURA_MONTHLENGTH) $f2f3e0e3a817edbd$var$UMALQURA_MONTHLENGTH = new Uint16Array(Uint8Array.from(atob($f2f3e0e3a817edbd$var$UMALQURA_DATA), (c)=>c.charCodeAt(0)).buffer);
|
|
144
144
|
if (!$f2f3e0e3a817edbd$var$UMALQURA_YEAR_START_TABLE) {
|
|
145
145
|
$f2f3e0e3a817edbd$var$UMALQURA_YEAR_START_TABLE = new Uint32Array($f2f3e0e3a817edbd$var$UMALQURA_YEAR_END - $f2f3e0e3a817edbd$var$UMALQURA_YEAR_START + 1);
|
|
@@ -78,11 +78,11 @@ const $b0ac0602ef646b2c$var$ERA_ADDENDS = [
|
|
|
78
78
|
2018
|
|
79
79
|
];
|
|
80
80
|
const $b0ac0602ef646b2c$var$ERA_NAMES = [
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
'meiji',
|
|
82
|
+
'taisho',
|
|
83
|
+
'showa',
|
|
84
|
+
'heisei',
|
|
85
|
+
'reiwa'
|
|
86
86
|
];
|
|
87
87
|
function $b0ac0602ef646b2c$var$findEraFromGregorianDate(date) {
|
|
88
88
|
const idx = $b0ac0602ef646b2c$var$ERA_START_DATES.findIndex(([year, month, day])=>{
|
|
@@ -97,7 +97,7 @@ function $b0ac0602ef646b2c$var$findEraFromGregorianDate(date) {
|
|
|
97
97
|
}
|
|
98
98
|
function $b0ac0602ef646b2c$var$toGregorian(date) {
|
|
99
99
|
let eraAddend = $b0ac0602ef646b2c$var$ERA_ADDENDS[$b0ac0602ef646b2c$var$ERA_NAMES.indexOf(date.era)];
|
|
100
|
-
if (!eraAddend) throw new Error(
|
|
100
|
+
if (!eraAddend) throw new Error('Unknown era: ' + date.era);
|
|
101
101
|
return new (0, $625ad1e1f4c43bc1$exports.CalendarDate)(date.year + eraAddend, date.month, date.day);
|
|
102
102
|
}
|
|
103
103
|
class $b0ac0602ef646b2c$export$b746ab2b60cdffbf extends (0, $af14c9812fdceb33$exports.GregorianCalendar) {
|
|
@@ -166,7 +166,7 @@ class $b0ac0602ef646b2c$export$b746ab2b60cdffbf extends (0, $af14c9812fdceb33$ex
|
|
|
166
166
|
}
|
|
167
167
|
constructor(...args){
|
|
168
168
|
super(...args);
|
|
169
|
-
this.identifier =
|
|
169
|
+
this.identifier = 'japanese';
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
function $b0ac0602ef646b2c$var$getMinimums(date) {
|
|
@@ -72,11 +72,11 @@ const $62225008020f0a13$var$ERA_ADDENDS = [
|
|
|
72
72
|
2018
|
|
73
73
|
];
|
|
74
74
|
const $62225008020f0a13$var$ERA_NAMES = [
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
'meiji',
|
|
76
|
+
'taisho',
|
|
77
|
+
'showa',
|
|
78
|
+
'heisei',
|
|
79
|
+
'reiwa'
|
|
80
80
|
];
|
|
81
81
|
function $62225008020f0a13$var$findEraFromGregorianDate(date) {
|
|
82
82
|
const idx = $62225008020f0a13$var$ERA_START_DATES.findIndex(([year, month, day])=>{
|
|
@@ -91,7 +91,7 @@ function $62225008020f0a13$var$findEraFromGregorianDate(date) {
|
|
|
91
91
|
}
|
|
92
92
|
function $62225008020f0a13$var$toGregorian(date) {
|
|
93
93
|
let eraAddend = $62225008020f0a13$var$ERA_ADDENDS[$62225008020f0a13$var$ERA_NAMES.indexOf(date.era)];
|
|
94
|
-
if (!eraAddend) throw new Error(
|
|
94
|
+
if (!eraAddend) throw new Error('Unknown era: ' + date.era);
|
|
95
95
|
return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(date.year + eraAddend, date.month, date.day);
|
|
96
96
|
}
|
|
97
97
|
class $62225008020f0a13$export$b746ab2b60cdffbf extends (0, $3b62074eb05584b2$export$80ee6245ec4f29ec) {
|
|
@@ -160,7 +160,7 @@ class $62225008020f0a13$export$b746ab2b60cdffbf extends (0, $3b62074eb05584b2$ex
|
|
|
160
160
|
}
|
|
161
161
|
constructor(...args){
|
|
162
162
|
super(...args);
|
|
163
|
-
this.identifier =
|
|
163
|
+
this.identifier = 'japanese';
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
function $62225008020f0a13$var$getMinimums(date) {
|
|
@@ -72,11 +72,11 @@ const $62225008020f0a13$var$ERA_ADDENDS = [
|
|
|
72
72
|
2018
|
|
73
73
|
];
|
|
74
74
|
const $62225008020f0a13$var$ERA_NAMES = [
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
'meiji',
|
|
76
|
+
'taisho',
|
|
77
|
+
'showa',
|
|
78
|
+
'heisei',
|
|
79
|
+
'reiwa'
|
|
80
80
|
];
|
|
81
81
|
function $62225008020f0a13$var$findEraFromGregorianDate(date) {
|
|
82
82
|
const idx = $62225008020f0a13$var$ERA_START_DATES.findIndex(([year, month, day])=>{
|
|
@@ -91,7 +91,7 @@ function $62225008020f0a13$var$findEraFromGregorianDate(date) {
|
|
|
91
91
|
}
|
|
92
92
|
function $62225008020f0a13$var$toGregorian(date) {
|
|
93
93
|
let eraAddend = $62225008020f0a13$var$ERA_ADDENDS[$62225008020f0a13$var$ERA_NAMES.indexOf(date.era)];
|
|
94
|
-
if (!eraAddend) throw new Error(
|
|
94
|
+
if (!eraAddend) throw new Error('Unknown era: ' + date.era);
|
|
95
95
|
return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(date.year + eraAddend, date.month, date.day);
|
|
96
96
|
}
|
|
97
97
|
class $62225008020f0a13$export$b746ab2b60cdffbf extends (0, $3b62074eb05584b2$export$80ee6245ec4f29ec) {
|
|
@@ -160,7 +160,7 @@ class $62225008020f0a13$export$b746ab2b60cdffbf extends (0, $3b62074eb05584b2$ex
|
|
|
160
160
|
}
|
|
161
161
|
constructor(...args){
|
|
162
162
|
super(...args);
|
|
163
|
-
this.identifier =
|
|
163
|
+
this.identifier = 'japanese';
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
function $62225008020f0a13$var$getMinimums(date) {
|
|
@@ -64,7 +64,7 @@ class $3c060181fc7249ae$export$37fccdbfd14c5939 {
|
|
|
64
64
|
}
|
|
65
65
|
getEras() {
|
|
66
66
|
return [
|
|
67
|
-
|
|
67
|
+
'AP'
|
|
68
68
|
];
|
|
69
69
|
}
|
|
70
70
|
getYearsInEra() {
|
|
@@ -73,7 +73,7 @@ class $3c060181fc7249ae$export$37fccdbfd14c5939 {
|
|
|
73
73
|
return 9377;
|
|
74
74
|
}
|
|
75
75
|
constructor(){
|
|
76
|
-
this.identifier =
|
|
76
|
+
this.identifier = 'persian';
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
package/dist/PersianCalendar.mjs
CHANGED
|
@@ -58,7 +58,7 @@ class $f3ed2e4472ae7e25$export$37fccdbfd14c5939 {
|
|
|
58
58
|
}
|
|
59
59
|
getEras() {
|
|
60
60
|
return [
|
|
61
|
-
|
|
61
|
+
'AP'
|
|
62
62
|
];
|
|
63
63
|
}
|
|
64
64
|
getYearsInEra() {
|
|
@@ -67,7 +67,7 @@ class $f3ed2e4472ae7e25$export$37fccdbfd14c5939 {
|
|
|
67
67
|
return 9377;
|
|
68
68
|
}
|
|
69
69
|
constructor(){
|
|
70
|
-
this.identifier =
|
|
70
|
+
this.identifier = 'persian';
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -58,7 +58,7 @@ class $f3ed2e4472ae7e25$export$37fccdbfd14c5939 {
|
|
|
58
58
|
}
|
|
59
59
|
getEras() {
|
|
60
60
|
return [
|
|
61
|
-
|
|
61
|
+
'AP'
|
|
62
62
|
];
|
|
63
63
|
}
|
|
64
64
|
getYearsInEra() {
|
|
@@ -67,7 +67,7 @@ class $f3ed2e4472ae7e25$export$37fccdbfd14c5939 {
|
|
|
67
67
|
return 9377;
|
|
68
68
|
}
|
|
69
69
|
constructor(){
|
|
70
|
-
this.identifier =
|
|
70
|
+
this.identifier = 'persian';
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -23,16 +23,16 @@ $parcel$export(module.exports, "TaiwanCalendar", () => $9cc5d3577ec40243$export$
|
|
|
23
23
|
|
|
24
24
|
const $9cc5d3577ec40243$var$TAIWAN_ERA_START = 1911;
|
|
25
25
|
function $9cc5d3577ec40243$var$gregorianYear(date) {
|
|
26
|
-
return date.era ===
|
|
26
|
+
return date.era === 'minguo' ? date.year + $9cc5d3577ec40243$var$TAIWAN_ERA_START : 1 - date.year + $9cc5d3577ec40243$var$TAIWAN_ERA_START;
|
|
27
27
|
}
|
|
28
28
|
function $9cc5d3577ec40243$var$gregorianToTaiwan(year) {
|
|
29
29
|
let y = year - $9cc5d3577ec40243$var$TAIWAN_ERA_START;
|
|
30
30
|
if (y > 0) return [
|
|
31
|
-
|
|
31
|
+
'minguo',
|
|
32
32
|
y
|
|
33
33
|
];
|
|
34
34
|
else return [
|
|
35
|
-
|
|
35
|
+
'before_minguo',
|
|
36
36
|
1 - y
|
|
37
37
|
];
|
|
38
38
|
}
|
|
@@ -48,8 +48,8 @@ class $9cc5d3577ec40243$export$65e01080afcb0799 extends (0, $af14c9812fdceb33$ex
|
|
|
48
48
|
}
|
|
49
49
|
getEras() {
|
|
50
50
|
return [
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
'before_minguo',
|
|
52
|
+
'minguo'
|
|
53
53
|
];
|
|
54
54
|
}
|
|
55
55
|
balanceDate(date) {
|
|
@@ -58,17 +58,17 @@ class $9cc5d3577ec40243$export$65e01080afcb0799 extends (0, $af14c9812fdceb33$ex
|
|
|
58
58
|
date.year = year;
|
|
59
59
|
}
|
|
60
60
|
isInverseEra(date) {
|
|
61
|
-
return date.era ===
|
|
61
|
+
return date.era === 'before_minguo';
|
|
62
62
|
}
|
|
63
63
|
getDaysInMonth(date) {
|
|
64
64
|
return super.getDaysInMonth($9cc5d3577ec40243$var$toGregorian(date));
|
|
65
65
|
}
|
|
66
66
|
getYearsInEra(date) {
|
|
67
|
-
return date.era ===
|
|
67
|
+
return date.era === 'before_minguo' ? 9999 : 9999 - $9cc5d3577ec40243$var$TAIWAN_ERA_START;
|
|
68
68
|
}
|
|
69
69
|
constructor(...args){
|
|
70
70
|
super(...args);
|
|
71
|
-
this.identifier =
|
|
71
|
+
this.identifier = 'roc' // Republic of China
|
|
72
72
|
;
|
|
73
73
|
}
|
|
74
74
|
}
|
package/dist/TaiwanCalendar.mjs
CHANGED
|
@@ -17,16 +17,16 @@ import {fromExtendedYear as $3b62074eb05584b2$export$4475b7e617eb123c, getExtend
|
|
|
17
17
|
|
|
18
18
|
const $5f31bd6f0c8940b2$var$TAIWAN_ERA_START = 1911;
|
|
19
19
|
function $5f31bd6f0c8940b2$var$gregorianYear(date) {
|
|
20
|
-
return date.era ===
|
|
20
|
+
return date.era === 'minguo' ? date.year + $5f31bd6f0c8940b2$var$TAIWAN_ERA_START : 1 - date.year + $5f31bd6f0c8940b2$var$TAIWAN_ERA_START;
|
|
21
21
|
}
|
|
22
22
|
function $5f31bd6f0c8940b2$var$gregorianToTaiwan(year) {
|
|
23
23
|
let y = year - $5f31bd6f0c8940b2$var$TAIWAN_ERA_START;
|
|
24
24
|
if (y > 0) return [
|
|
25
|
-
|
|
25
|
+
'minguo',
|
|
26
26
|
y
|
|
27
27
|
];
|
|
28
28
|
else return [
|
|
29
|
-
|
|
29
|
+
'before_minguo',
|
|
30
30
|
1 - y
|
|
31
31
|
];
|
|
32
32
|
}
|
|
@@ -42,8 +42,8 @@ class $5f31bd6f0c8940b2$export$65e01080afcb0799 extends (0, $3b62074eb05584b2$ex
|
|
|
42
42
|
}
|
|
43
43
|
getEras() {
|
|
44
44
|
return [
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
'before_minguo',
|
|
46
|
+
'minguo'
|
|
47
47
|
];
|
|
48
48
|
}
|
|
49
49
|
balanceDate(date) {
|
|
@@ -52,17 +52,17 @@ class $5f31bd6f0c8940b2$export$65e01080afcb0799 extends (0, $3b62074eb05584b2$ex
|
|
|
52
52
|
date.year = year;
|
|
53
53
|
}
|
|
54
54
|
isInverseEra(date) {
|
|
55
|
-
return date.era ===
|
|
55
|
+
return date.era === 'before_minguo';
|
|
56
56
|
}
|
|
57
57
|
getDaysInMonth(date) {
|
|
58
58
|
return super.getDaysInMonth($5f31bd6f0c8940b2$var$toGregorian(date));
|
|
59
59
|
}
|
|
60
60
|
getYearsInEra(date) {
|
|
61
|
-
return date.era ===
|
|
61
|
+
return date.era === 'before_minguo' ? 9999 : 9999 - $5f31bd6f0c8940b2$var$TAIWAN_ERA_START;
|
|
62
62
|
}
|
|
63
63
|
constructor(...args){
|
|
64
64
|
super(...args);
|
|
65
|
-
this.identifier =
|
|
65
|
+
this.identifier = 'roc' // Republic of China
|
|
66
66
|
;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -17,16 +17,16 @@ import {fromExtendedYear as $3b62074eb05584b2$export$4475b7e617eb123c, getExtend
|
|
|
17
17
|
|
|
18
18
|
const $5f31bd6f0c8940b2$var$TAIWAN_ERA_START = 1911;
|
|
19
19
|
function $5f31bd6f0c8940b2$var$gregorianYear(date) {
|
|
20
|
-
return date.era ===
|
|
20
|
+
return date.era === 'minguo' ? date.year + $5f31bd6f0c8940b2$var$TAIWAN_ERA_START : 1 - date.year + $5f31bd6f0c8940b2$var$TAIWAN_ERA_START;
|
|
21
21
|
}
|
|
22
22
|
function $5f31bd6f0c8940b2$var$gregorianToTaiwan(year) {
|
|
23
23
|
let y = year - $5f31bd6f0c8940b2$var$TAIWAN_ERA_START;
|
|
24
24
|
if (y > 0) return [
|
|
25
|
-
|
|
25
|
+
'minguo',
|
|
26
26
|
y
|
|
27
27
|
];
|
|
28
28
|
else return [
|
|
29
|
-
|
|
29
|
+
'before_minguo',
|
|
30
30
|
1 - y
|
|
31
31
|
];
|
|
32
32
|
}
|
|
@@ -42,8 +42,8 @@ class $5f31bd6f0c8940b2$export$65e01080afcb0799 extends (0, $3b62074eb05584b2$ex
|
|
|
42
42
|
}
|
|
43
43
|
getEras() {
|
|
44
44
|
return [
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
'before_minguo',
|
|
46
|
+
'minguo'
|
|
47
47
|
];
|
|
48
48
|
}
|
|
49
49
|
balanceDate(date) {
|
|
@@ -52,17 +52,17 @@ class $5f31bd6f0c8940b2$export$65e01080afcb0799 extends (0, $3b62074eb05584b2$ex
|
|
|
52
52
|
date.year = year;
|
|
53
53
|
}
|
|
54
54
|
isInverseEra(date) {
|
|
55
|
-
return date.era ===
|
|
55
|
+
return date.era === 'before_minguo';
|
|
56
56
|
}
|
|
57
57
|
getDaysInMonth(date) {
|
|
58
58
|
return super.getDaysInMonth($5f31bd6f0c8940b2$var$toGregorian(date));
|
|
59
59
|
}
|
|
60
60
|
getYearsInEra(date) {
|
|
61
|
-
return date.era ===
|
|
61
|
+
return date.era === 'before_minguo' ? 9999 : 9999 - $5f31bd6f0c8940b2$var$TAIWAN_ERA_START;
|
|
62
62
|
}
|
|
63
63
|
constructor(...args){
|
|
64
64
|
super(...args);
|
|
65
|
-
this.identifier =
|
|
65
|
+
this.identifier = 'roc' // Republic of China
|
|
66
66
|
;
|
|
67
67
|
}
|
|
68
68
|
}
|
package/dist/conversion.main.js
CHANGED
|
@@ -53,7 +53,7 @@ function $4ae0260a69729f1d$var$epochFromParts(year, month, day, hour, minute, se
|
|
|
53
53
|
}
|
|
54
54
|
function $4ae0260a69729f1d$export$59c99f3515d3493f(ms, timeZone) {
|
|
55
55
|
// Fast path for UTC.
|
|
56
|
-
if (timeZone ===
|
|
56
|
+
if (timeZone === 'UTC') return 0;
|
|
57
57
|
// Fast path: for local timezone after 1970, use native Date.
|
|
58
58
|
if (ms > 0 && timeZone === (0, $1f0f7ebf1ae6c530$exports.getLocalTimeZone)()) return new Date(ms).getTimezoneOffset() * -60000;
|
|
59
59
|
let { year: year, month: month, day: day, hour: hour, minute: minute, second: second } = $4ae0260a69729f1d$var$getTimeZoneParts(ms, timeZone);
|
|
@@ -64,28 +64,28 @@ const $4ae0260a69729f1d$var$formattersByTimeZone = new Map();
|
|
|
64
64
|
function $4ae0260a69729f1d$var$getTimeZoneParts(ms, timeZone) {
|
|
65
65
|
let formatter = $4ae0260a69729f1d$var$formattersByTimeZone.get(timeZone);
|
|
66
66
|
if (!formatter) {
|
|
67
|
-
formatter = new Intl.DateTimeFormat(
|
|
67
|
+
formatter = new Intl.DateTimeFormat('en-US', {
|
|
68
68
|
timeZone: timeZone,
|
|
69
69
|
hour12: false,
|
|
70
|
-
era:
|
|
71
|
-
year:
|
|
72
|
-
month:
|
|
73
|
-
day:
|
|
74
|
-
hour:
|
|
75
|
-
minute:
|
|
76
|
-
second:
|
|
70
|
+
era: 'short',
|
|
71
|
+
year: 'numeric',
|
|
72
|
+
month: 'numeric',
|
|
73
|
+
day: 'numeric',
|
|
74
|
+
hour: 'numeric',
|
|
75
|
+
minute: 'numeric',
|
|
76
|
+
second: 'numeric'
|
|
77
77
|
});
|
|
78
78
|
$4ae0260a69729f1d$var$formattersByTimeZone.set(timeZone, formatter);
|
|
79
79
|
}
|
|
80
80
|
let parts = formatter.formatToParts(new Date(ms));
|
|
81
81
|
let namedParts = {};
|
|
82
|
-
for (let part of parts)if (part.type !==
|
|
82
|
+
for (let part of parts)if (part.type !== 'literal') namedParts[part.type] = part.value;
|
|
83
83
|
return {
|
|
84
84
|
// Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253
|
|
85
|
-
year: namedParts.era ===
|
|
85
|
+
year: namedParts.era === 'BC' || namedParts.era === 'B' ? -namedParts.year + 1 : +namedParts.year,
|
|
86
86
|
month: +namedParts.month,
|
|
87
87
|
day: +namedParts.day,
|
|
88
|
-
hour: namedParts.hour ===
|
|
88
|
+
hour: namedParts.hour === '24' ? 0 : +namedParts.hour,
|
|
89
89
|
minute: +namedParts.minute,
|
|
90
90
|
second: +namedParts.second
|
|
91
91
|
};
|
|
@@ -110,12 +110,12 @@ function $4ae0260a69729f1d$var$isValidWallTime(date, timeZone, absolute) {
|
|
|
110
110
|
let parts = $4ae0260a69729f1d$var$getTimeZoneParts(absolute, timeZone);
|
|
111
111
|
return date.year === parts.year && date.month === parts.month && date.day === parts.day && date.hour === parts.hour && date.minute === parts.minute && date.second === parts.second;
|
|
112
112
|
}
|
|
113
|
-
function $4ae0260a69729f1d$export$5107c82f94518f5c(date, timeZone, disambiguation =
|
|
113
|
+
function $4ae0260a69729f1d$export$5107c82f94518f5c(date, timeZone, disambiguation = 'compatible') {
|
|
114
114
|
let dateTime = $4ae0260a69729f1d$export$b21e0b124e224484(date);
|
|
115
115
|
// Fast path: if the time zone is UTC, use native Date.
|
|
116
|
-
if (timeZone ===
|
|
116
|
+
if (timeZone === 'UTC') return $4ae0260a69729f1d$export$bd4fb2bc8bb06fb(dateTime);
|
|
117
117
|
// Fast path: if the time zone is the local timezone and disambiguation is compatible, use native Date.
|
|
118
|
-
if (timeZone === (0, $1f0f7ebf1ae6c530$exports.getLocalTimeZone)() && disambiguation ===
|
|
118
|
+
if (timeZone === (0, $1f0f7ebf1ae6c530$exports.getLocalTimeZone)() && disambiguation === 'compatible') {
|
|
119
119
|
dateTime = $4ae0260a69729f1d$export$b4a036af3fc0b032(dateTime, new (0, $af14c9812fdceb33$exports.GregorianCalendar)());
|
|
120
120
|
// Don't use Date constructor here because two-digit years are interpreted in the 20th century.
|
|
121
121
|
let date = new Date();
|
|
@@ -131,26 +131,26 @@ function $4ae0260a69729f1d$export$5107c82f94518f5c(date, timeZone, disambiguatio
|
|
|
131
131
|
if (valid.length === 1) return valid[0];
|
|
132
132
|
if (valid.length > 1) switch(disambiguation){
|
|
133
133
|
// 'compatible' means 'earlier' for "fall back" transitions
|
|
134
|
-
case
|
|
135
|
-
case
|
|
134
|
+
case 'compatible':
|
|
135
|
+
case 'earlier':
|
|
136
136
|
return valid[0];
|
|
137
|
-
case
|
|
137
|
+
case 'later':
|
|
138
138
|
return valid[valid.length - 1];
|
|
139
|
-
case
|
|
140
|
-
throw new RangeError(
|
|
139
|
+
case 'reject':
|
|
140
|
+
throw new RangeError('Multiple possible absolute times found');
|
|
141
141
|
}
|
|
142
142
|
switch(disambiguation){
|
|
143
|
-
case
|
|
143
|
+
case 'earlier':
|
|
144
144
|
return Math.min(ms - offsetBefore, ms - offsetAfter);
|
|
145
145
|
// 'compatible' means 'later' for "spring forward" transitions
|
|
146
|
-
case
|
|
147
|
-
case
|
|
146
|
+
case 'compatible':
|
|
147
|
+
case 'later':
|
|
148
148
|
return Math.max(ms - offsetBefore, ms - offsetAfter);
|
|
149
|
-
case
|
|
150
|
-
throw new RangeError(
|
|
149
|
+
case 'reject':
|
|
150
|
+
throw new RangeError('No such absolute time found');
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
function $4ae0260a69729f1d$export$e67a095c620b86fe(dateTime, timeZone, disambiguation =
|
|
153
|
+
function $4ae0260a69729f1d$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = 'compatible') {
|
|
154
154
|
return new Date($4ae0260a69729f1d$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));
|
|
155
155
|
}
|
|
156
156
|
function $4ae0260a69729f1d$export$1b96692a1ba042ac(ms, timeZone) {
|
|
@@ -192,8 +192,8 @@ function $4ae0260a69729f1d$export$4d0393e732857be5(date) {
|
|
|
192
192
|
}
|
|
193
193
|
function $4ae0260a69729f1d$export$b21e0b124e224484(date, time) {
|
|
194
194
|
let hour = 0, minute = 0, second = 0, millisecond = 0;
|
|
195
|
-
if (
|
|
196
|
-
else if (
|
|
195
|
+
if ('timeZone' in date) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = date);
|
|
196
|
+
else if ('hour' in date && !time) return date;
|
|
197
197
|
if (time) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = time);
|
|
198
198
|
return new (0, $625ad1e1f4c43bc1$exports.CalendarDateTime)(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);
|
|
199
199
|
}
|
package/dist/conversion.mjs
CHANGED
|
@@ -34,7 +34,7 @@ function $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, se
|
|
|
34
34
|
}
|
|
35
35
|
function $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone) {
|
|
36
36
|
// Fast path for UTC.
|
|
37
|
-
if (timeZone ===
|
|
37
|
+
if (timeZone === 'UTC') return 0;
|
|
38
38
|
// Fast path: for local timezone after 1970, use native Date.
|
|
39
39
|
if (ms > 0 && timeZone === (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)()) return new Date(ms).getTimezoneOffset() * -60000;
|
|
40
40
|
let { year: year, month: month, day: day, hour: hour, minute: minute, second: second } = $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone);
|
|
@@ -45,28 +45,28 @@ const $11d87f3f76e88657$var$formattersByTimeZone = new Map();
|
|
|
45
45
|
function $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone) {
|
|
46
46
|
let formatter = $11d87f3f76e88657$var$formattersByTimeZone.get(timeZone);
|
|
47
47
|
if (!formatter) {
|
|
48
|
-
formatter = new Intl.DateTimeFormat(
|
|
48
|
+
formatter = new Intl.DateTimeFormat('en-US', {
|
|
49
49
|
timeZone: timeZone,
|
|
50
50
|
hour12: false,
|
|
51
|
-
era:
|
|
52
|
-
year:
|
|
53
|
-
month:
|
|
54
|
-
day:
|
|
55
|
-
hour:
|
|
56
|
-
minute:
|
|
57
|
-
second:
|
|
51
|
+
era: 'short',
|
|
52
|
+
year: 'numeric',
|
|
53
|
+
month: 'numeric',
|
|
54
|
+
day: 'numeric',
|
|
55
|
+
hour: 'numeric',
|
|
56
|
+
minute: 'numeric',
|
|
57
|
+
second: 'numeric'
|
|
58
58
|
});
|
|
59
59
|
$11d87f3f76e88657$var$formattersByTimeZone.set(timeZone, formatter);
|
|
60
60
|
}
|
|
61
61
|
let parts = formatter.formatToParts(new Date(ms));
|
|
62
62
|
let namedParts = {};
|
|
63
|
-
for (let part of parts)if (part.type !==
|
|
63
|
+
for (let part of parts)if (part.type !== 'literal') namedParts[part.type] = part.value;
|
|
64
64
|
return {
|
|
65
65
|
// Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253
|
|
66
|
-
year: namedParts.era ===
|
|
66
|
+
year: namedParts.era === 'BC' || namedParts.era === 'B' ? -namedParts.year + 1 : +namedParts.year,
|
|
67
67
|
month: +namedParts.month,
|
|
68
68
|
day: +namedParts.day,
|
|
69
|
-
hour: namedParts.hour ===
|
|
69
|
+
hour: namedParts.hour === '24' ? 0 : +namedParts.hour,
|
|
70
70
|
minute: +namedParts.minute,
|
|
71
71
|
second: +namedParts.second
|
|
72
72
|
};
|
|
@@ -91,12 +91,12 @@ function $11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute) {
|
|
|
91
91
|
let parts = $11d87f3f76e88657$var$getTimeZoneParts(absolute, timeZone);
|
|
92
92
|
return date.year === parts.year && date.month === parts.month && date.day === parts.day && date.hour === parts.hour && date.minute === parts.minute && date.second === parts.second;
|
|
93
93
|
}
|
|
94
|
-
function $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation =
|
|
94
|
+
function $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation = 'compatible') {
|
|
95
95
|
let dateTime = $11d87f3f76e88657$export$b21e0b124e224484(date);
|
|
96
96
|
// Fast path: if the time zone is UTC, use native Date.
|
|
97
|
-
if (timeZone ===
|
|
97
|
+
if (timeZone === 'UTC') return $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);
|
|
98
98
|
// Fast path: if the time zone is the local timezone and disambiguation is compatible, use native Date.
|
|
99
|
-
if (timeZone === (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)() && disambiguation ===
|
|
99
|
+
if (timeZone === (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)() && disambiguation === 'compatible') {
|
|
100
100
|
dateTime = $11d87f3f76e88657$export$b4a036af3fc0b032(dateTime, new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)());
|
|
101
101
|
// Don't use Date constructor here because two-digit years are interpreted in the 20th century.
|
|
102
102
|
let date = new Date();
|
|
@@ -112,26 +112,26 @@ function $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguatio
|
|
|
112
112
|
if (valid.length === 1) return valid[0];
|
|
113
113
|
if (valid.length > 1) switch(disambiguation){
|
|
114
114
|
// 'compatible' means 'earlier' for "fall back" transitions
|
|
115
|
-
case
|
|
116
|
-
case
|
|
115
|
+
case 'compatible':
|
|
116
|
+
case 'earlier':
|
|
117
117
|
return valid[0];
|
|
118
|
-
case
|
|
118
|
+
case 'later':
|
|
119
119
|
return valid[valid.length - 1];
|
|
120
|
-
case
|
|
121
|
-
throw new RangeError(
|
|
120
|
+
case 'reject':
|
|
121
|
+
throw new RangeError('Multiple possible absolute times found');
|
|
122
122
|
}
|
|
123
123
|
switch(disambiguation){
|
|
124
|
-
case
|
|
124
|
+
case 'earlier':
|
|
125
125
|
return Math.min(ms - offsetBefore, ms - offsetAfter);
|
|
126
126
|
// 'compatible' means 'later' for "spring forward" transitions
|
|
127
|
-
case
|
|
128
|
-
case
|
|
127
|
+
case 'compatible':
|
|
128
|
+
case 'later':
|
|
129
129
|
return Math.max(ms - offsetBefore, ms - offsetAfter);
|
|
130
|
-
case
|
|
131
|
-
throw new RangeError(
|
|
130
|
+
case 'reject':
|
|
131
|
+
throw new RangeError('No such absolute time found');
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
function $11d87f3f76e88657$export$e67a095c620b86fe(dateTime, timeZone, disambiguation =
|
|
134
|
+
function $11d87f3f76e88657$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = 'compatible') {
|
|
135
135
|
return new Date($11d87f3f76e88657$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));
|
|
136
136
|
}
|
|
137
137
|
function $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone) {
|
|
@@ -173,8 +173,8 @@ function $11d87f3f76e88657$export$4d0393e732857be5(date) {
|
|
|
173
173
|
}
|
|
174
174
|
function $11d87f3f76e88657$export$b21e0b124e224484(date, time) {
|
|
175
175
|
let hour = 0, minute = 0, second = 0, millisecond = 0;
|
|
176
|
-
if (
|
|
177
|
-
else if (
|
|
176
|
+
if ('timeZone' in date) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = date);
|
|
177
|
+
else if ('hour' in date && !time) return date;
|
|
178
178
|
if (time) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = time);
|
|
179
179
|
return new (0, $35ea8db9cb2ccb90$export$ca871e8dbb80966f)(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);
|
|
180
180
|
}
|