@internationalized/date 3.0.0-alpha.2 → 3.0.0-alpha.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/main.js +724 -706
- package/dist/main.js.map +1 -1
- package/dist/module.js +705 -687
- package/dist/module.js.map +1 -1
- package/package.json +2 -2
package/dist/main.js
CHANGED
|
@@ -18,78 +18,78 @@ function $parcel$exportWildcard(dest, source) {
|
|
|
18
18
|
return dest;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
$parcel$export(module.exports, "GregorianCalendar", () => $
|
|
22
|
-
$parcel$export(module.exports, "JapaneseCalendar", () => $
|
|
23
|
-
$parcel$export(module.exports, "BuddhistCalendar", () => $
|
|
24
|
-
$parcel$export(module.exports, "TaiwanCalendar", () => $
|
|
25
|
-
$parcel$export(module.exports, "PersianCalendar", () => $
|
|
26
|
-
$parcel$export(module.exports, "IndianCalendar", () => $
|
|
27
|
-
$parcel$export(module.exports, "IslamicCivilCalendar", () => $
|
|
28
|
-
$parcel$export(module.exports, "IslamicTabularCalendar", () => $
|
|
29
|
-
$parcel$export(module.exports, "IslamicUmalquraCalendar", () => $
|
|
30
|
-
$parcel$export(module.exports, "HebrewCalendar", () => $
|
|
31
|
-
$parcel$export(module.exports, "EthiopicCalendar", () => $
|
|
32
|
-
$parcel$export(module.exports, "EthiopicAmeteAlemCalendar", () => $
|
|
33
|
-
$parcel$export(module.exports, "CopticCalendar", () => $
|
|
34
|
-
$parcel$export(module.exports, "createCalendar", () => $
|
|
35
|
-
var $
|
|
36
|
-
|
|
37
|
-
$parcel$export($
|
|
38
|
-
$parcel$export($
|
|
39
|
-
$parcel$export($
|
|
40
|
-
$parcel$export($
|
|
41
|
-
var $
|
|
42
|
-
|
|
43
|
-
$parcel$export($
|
|
44
|
-
$parcel$export($
|
|
45
|
-
$parcel$export($
|
|
46
|
-
$parcel$export($
|
|
47
|
-
$parcel$export($
|
|
48
|
-
$parcel$export($
|
|
49
|
-
$parcel$export($
|
|
50
|
-
$parcel$export($
|
|
51
|
-
$parcel$export($
|
|
52
|
-
$parcel$export($
|
|
53
|
-
$parcel$export($
|
|
54
|
-
$parcel$export($
|
|
55
|
-
$parcel$export($
|
|
56
|
-
$parcel$export($
|
|
57
|
-
$parcel$export($
|
|
58
|
-
$parcel$export($
|
|
59
|
-
$parcel$export($
|
|
60
|
-
$parcel$export($
|
|
61
|
-
|
|
62
|
-
var $
|
|
63
|
-
|
|
64
|
-
$parcel$export($
|
|
65
|
-
$parcel$export($
|
|
66
|
-
$parcel$export($
|
|
67
|
-
$parcel$export($
|
|
68
|
-
$parcel$export($
|
|
69
|
-
$parcel$export($
|
|
70
|
-
$parcel$export($
|
|
71
|
-
$parcel$export($
|
|
72
|
-
$parcel$export($
|
|
73
|
-
$parcel$export($
|
|
74
|
-
$parcel$export($
|
|
75
|
-
$parcel$export($
|
|
76
|
-
$parcel$export($
|
|
77
|
-
$parcel$export($
|
|
78
|
-
$parcel$export($
|
|
79
|
-
$parcel$export($
|
|
80
|
-
$parcel$export($
|
|
81
|
-
$parcel$export($
|
|
82
|
-
$parcel$export($
|
|
83
|
-
$parcel$export($
|
|
84
|
-
$parcel$export($
|
|
85
|
-
$parcel$export($
|
|
86
|
-
$parcel$export($
|
|
87
|
-
$parcel$export($
|
|
88
|
-
$parcel$export($
|
|
89
|
-
$parcel$export($
|
|
90
|
-
$parcel$export($
|
|
91
|
-
|
|
92
|
-
const $
|
|
21
|
+
$parcel$export(module.exports, "GregorianCalendar", () => $680b26d521b88d00$export$80ee6245ec4f29ec);
|
|
22
|
+
$parcel$export(module.exports, "JapaneseCalendar", () => $a829bc7a11c5e72b$export$b746ab2b60cdffbf);
|
|
23
|
+
$parcel$export(module.exports, "BuddhistCalendar", () => $3d8b8d698eadd9f9$export$42d20a78301dee44);
|
|
24
|
+
$parcel$export(module.exports, "TaiwanCalendar", () => $3787fdcbabdfc7bd$export$65e01080afcb0799);
|
|
25
|
+
$parcel$export(module.exports, "PersianCalendar", () => $75fdc3cae9bb671c$export$37fccdbfd14c5939);
|
|
26
|
+
$parcel$export(module.exports, "IndianCalendar", () => $8626c25ab1e2c78a$export$39f31c639fa15726);
|
|
27
|
+
$parcel$export(module.exports, "IslamicCivilCalendar", () => $4f37d2a9fc47c3f0$export$2066795aadd37bfc);
|
|
28
|
+
$parcel$export(module.exports, "IslamicTabularCalendar", () => $4f37d2a9fc47c3f0$export$37f0887f2f9d22f7);
|
|
29
|
+
$parcel$export(module.exports, "IslamicUmalquraCalendar", () => $4f37d2a9fc47c3f0$export$5baab4758c231076);
|
|
30
|
+
$parcel$export(module.exports, "HebrewCalendar", () => $7e9e96397d8405f3$export$ca405048b8fb5af);
|
|
31
|
+
$parcel$export(module.exports, "EthiopicCalendar", () => $241b3c900de4f5b3$export$26ba6eab5e20cd7d);
|
|
32
|
+
$parcel$export(module.exports, "EthiopicAmeteAlemCalendar", () => $241b3c900de4f5b3$export$d72e0c37005a4914);
|
|
33
|
+
$parcel$export(module.exports, "CopticCalendar", () => $241b3c900de4f5b3$export$fe6243cbe1a4b7c1);
|
|
34
|
+
$parcel$export(module.exports, "createCalendar", () => $0e6dd8ee1e86aa7f$export$dd0bbc9b26defe37);
|
|
35
|
+
var $e2d97aa3b7775168$exports = {};
|
|
36
|
+
|
|
37
|
+
$parcel$export($e2d97aa3b7775168$exports, "CalendarDate", () => $e2d97aa3b7775168$export$99faa760c7908e4f);
|
|
38
|
+
$parcel$export($e2d97aa3b7775168$exports, "Time", () => $e2d97aa3b7775168$export$680ea196effce5f);
|
|
39
|
+
$parcel$export($e2d97aa3b7775168$exports, "CalendarDateTime", () => $e2d97aa3b7775168$export$ca871e8dbb80966f);
|
|
40
|
+
$parcel$export($e2d97aa3b7775168$exports, "ZonedDateTime", () => $e2d97aa3b7775168$export$d3b7288e7994edea);
|
|
41
|
+
var $6de69c682dff3674$exports = {};
|
|
42
|
+
|
|
43
|
+
$parcel$export($6de69c682dff3674$exports, "epochFromDate", () => $6de69c682dff3674$export$bd4fb2bc8bb06fb);
|
|
44
|
+
$parcel$export($6de69c682dff3674$exports, "toCalendar", () => $6de69c682dff3674$export$b4a036af3fc0b032);
|
|
45
|
+
$parcel$export($6de69c682dff3674$exports, "getTimeZoneOffset", () => $6de69c682dff3674$export$59c99f3515d3493f);
|
|
46
|
+
$parcel$export($6de69c682dff3674$exports, "possibleAbsolutes", () => $6de69c682dff3674$export$136f38efe7caf549);
|
|
47
|
+
$parcel$export($6de69c682dff3674$exports, "toAbsolute", () => $6de69c682dff3674$export$5107c82f94518f5c);
|
|
48
|
+
$parcel$export($6de69c682dff3674$exports, "toCalendarDateTime", () => $6de69c682dff3674$export$b21e0b124e224484);
|
|
49
|
+
$parcel$export($6de69c682dff3674$exports, "toDate", () => $6de69c682dff3674$export$e67a095c620b86fe);
|
|
50
|
+
$parcel$export($6de69c682dff3674$exports, "fromAbsolute", () => $6de69c682dff3674$export$1b96692a1ba042ac);
|
|
51
|
+
$parcel$export($6de69c682dff3674$exports, "fromDate", () => $6de69c682dff3674$export$e57ff100d91bd4b9);
|
|
52
|
+
$parcel$export($6de69c682dff3674$exports, "fromDateToLocal", () => $6de69c682dff3674$export$d7f92bcd3596b086);
|
|
53
|
+
$parcel$export($6de69c682dff3674$exports, "toCalendarDate", () => $6de69c682dff3674$export$93522d1a439f3617);
|
|
54
|
+
$parcel$export($6de69c682dff3674$exports, "toDateFields", () => $6de69c682dff3674$export$6f4d78149f3f53ac);
|
|
55
|
+
$parcel$export($6de69c682dff3674$exports, "toTimeFields", () => $6de69c682dff3674$export$4d0393e732857be5);
|
|
56
|
+
$parcel$export($6de69c682dff3674$exports, "toTime", () => $6de69c682dff3674$export$d33f79e3ffc3dc83);
|
|
57
|
+
$parcel$export($6de69c682dff3674$exports, "toZoned", () => $6de69c682dff3674$export$84c95a83c799e074);
|
|
58
|
+
$parcel$export($6de69c682dff3674$exports, "toTimeZone", () => $6de69c682dff3674$export$538b00033cc11c75);
|
|
59
|
+
$parcel$export($6de69c682dff3674$exports, "zonedToDate", () => $6de69c682dff3674$export$83aac07b4c37b25);
|
|
60
|
+
$parcel$export($6de69c682dff3674$exports, "toLocalTimeZone", () => $6de69c682dff3674$export$d9b67bc93c097491);
|
|
61
|
+
|
|
62
|
+
var $8180638d62fba910$exports = {};
|
|
63
|
+
|
|
64
|
+
$parcel$export($8180638d62fba910$exports, "isSameDay", () => $8180638d62fba910$export$ea39ec197993aef0);
|
|
65
|
+
$parcel$export($8180638d62fba910$exports, "isSameMonth", () => $8180638d62fba910$export$a18c89cbd24170ff);
|
|
66
|
+
$parcel$export($8180638d62fba910$exports, "startOfMonth", () => $8180638d62fba910$export$a5a3b454ada2268e);
|
|
67
|
+
$parcel$export($8180638d62fba910$exports, "isSameYear", () => $8180638d62fba910$export$5841f9eb9773f25f);
|
|
68
|
+
$parcel$export($8180638d62fba910$exports, "startOfYear", () => $8180638d62fba910$export$f91e89d3d0406102);
|
|
69
|
+
$parcel$export($8180638d62fba910$exports, "isEqualDay", () => $8180638d62fba910$export$91b62ebf2ba703ee);
|
|
70
|
+
$parcel$export($8180638d62fba910$exports, "isEqualMonth", () => $8180638d62fba910$export$5a8da0c44a3afdf2);
|
|
71
|
+
$parcel$export($8180638d62fba910$exports, "isEqualYear", () => $8180638d62fba910$export$ea840f5a6dda8147);
|
|
72
|
+
$parcel$export($8180638d62fba910$exports, "isToday", () => $8180638d62fba910$export$629b0a497aa65267);
|
|
73
|
+
$parcel$export($8180638d62fba910$exports, "today", () => $8180638d62fba910$export$d0bdf45af03a6ea3);
|
|
74
|
+
$parcel$export($8180638d62fba910$exports, "getDayOfWeek", () => $8180638d62fba910$export$2061056d06d7cdf7);
|
|
75
|
+
$parcel$export($8180638d62fba910$exports, "now", () => $8180638d62fba910$export$461939dd4422153);
|
|
76
|
+
$parcel$export($8180638d62fba910$exports, "compareDate", () => $8180638d62fba910$export$68781ddf31c0090f);
|
|
77
|
+
$parcel$export($8180638d62fba910$exports, "compareTime", () => $8180638d62fba910$export$c19a80a9721b80f6);
|
|
78
|
+
$parcel$export($8180638d62fba910$exports, "getHoursInDay", () => $8180638d62fba910$export$126c91c941de7e);
|
|
79
|
+
$parcel$export($8180638d62fba910$exports, "getLocalTimeZone", () => $8180638d62fba910$export$aa8b41735afcabd2);
|
|
80
|
+
$parcel$export($8180638d62fba910$exports, "endOfMonth", () => $8180638d62fba910$export$a2258d9c4118825c);
|
|
81
|
+
$parcel$export($8180638d62fba910$exports, "endOfYear", () => $8180638d62fba910$export$8b7aa55c66d5569e);
|
|
82
|
+
$parcel$export($8180638d62fba910$exports, "getMinimumMonthInYear", () => $8180638d62fba910$export$5412ac11713b72ad);
|
|
83
|
+
$parcel$export($8180638d62fba910$exports, "getMinimumDayInMonth", () => $8180638d62fba910$export$b2f4953d301981d5);
|
|
84
|
+
$parcel$export($8180638d62fba910$exports, "startOfWeek", () => $8180638d62fba910$export$42c81a444fbfb5d4);
|
|
85
|
+
$parcel$export($8180638d62fba910$exports, "endOfWeek", () => $8180638d62fba910$export$ef8b6d9133084f4e);
|
|
86
|
+
$parcel$export($8180638d62fba910$exports, "getWeeksInMonth", () => $8180638d62fba910$export$ccc1b2479e7dd654);
|
|
87
|
+
$parcel$export($8180638d62fba910$exports, "minDate", () => $8180638d62fba910$export$5c333a116e949cdd);
|
|
88
|
+
$parcel$export($8180638d62fba910$exports, "maxDate", () => $8180638d62fba910$export$a75f2bff57811055);
|
|
89
|
+
$parcel$export($8180638d62fba910$exports, "isWeekend", () => $8180638d62fba910$export$618d60ea299da42);
|
|
90
|
+
$parcel$export($8180638d62fba910$exports, "isWeekday", () => $8180638d62fba910$export$ee9d87258e1d19ed);
|
|
91
|
+
|
|
92
|
+
const $580b85229f2cb211$export$7a5acbd77d414bd9 = {
|
|
93
93
|
'001': 1,
|
|
94
94
|
AD: 1,
|
|
95
95
|
AE: 6,
|
|
@@ -185,127 +185,127 @@ const $166fa5c83bf980e5$export$7a5acbd77d414bd9 = {
|
|
|
185
185
|
};
|
|
186
186
|
|
|
187
187
|
|
|
188
|
-
function $
|
|
189
|
-
b = $
|
|
188
|
+
function $8180638d62fba910$export$ea39ec197993aef0(a, b) {
|
|
189
|
+
b = $6de69c682dff3674$export$b4a036af3fc0b032(b, a.calendar);
|
|
190
190
|
return a.era === b.era && a.year === b.year && a.month === b.month && a.day === b.day;
|
|
191
191
|
}
|
|
192
|
-
function $
|
|
193
|
-
b = $
|
|
192
|
+
function $8180638d62fba910$export$a18c89cbd24170ff(a, b) {
|
|
193
|
+
b = $6de69c682dff3674$export$b4a036af3fc0b032(b, a.calendar);
|
|
194
194
|
// In the Japanese calendar, months can span multiple eras/years, so only compare the first of the month.
|
|
195
|
-
a = $
|
|
196
|
-
b = $
|
|
195
|
+
a = $8180638d62fba910$export$a5a3b454ada2268e(a);
|
|
196
|
+
b = $8180638d62fba910$export$a5a3b454ada2268e(b);
|
|
197
197
|
return a.era === b.era && a.year === b.year && a.month === b.month;
|
|
198
198
|
}
|
|
199
|
-
function $
|
|
200
|
-
b = $
|
|
201
|
-
a = $
|
|
202
|
-
b = $
|
|
199
|
+
function $8180638d62fba910$export$5841f9eb9773f25f(a, b) {
|
|
200
|
+
b = $6de69c682dff3674$export$b4a036af3fc0b032(b, a.calendar);
|
|
201
|
+
a = $8180638d62fba910$export$f91e89d3d0406102(a);
|
|
202
|
+
b = $8180638d62fba910$export$f91e89d3d0406102(b);
|
|
203
203
|
return a.era === b.era && a.year === b.year;
|
|
204
204
|
}
|
|
205
|
-
function $
|
|
205
|
+
function $8180638d62fba910$export$91b62ebf2ba703ee(a, b) {
|
|
206
206
|
return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year && a.month === b.month && a.day === b.day;
|
|
207
207
|
}
|
|
208
|
-
function $
|
|
209
|
-
a = $
|
|
210
|
-
b = $
|
|
208
|
+
function $8180638d62fba910$export$5a8da0c44a3afdf2(a, b) {
|
|
209
|
+
a = $8180638d62fba910$export$a5a3b454ada2268e(a);
|
|
210
|
+
b = $8180638d62fba910$export$a5a3b454ada2268e(b);
|
|
211
211
|
return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year && a.month === b.month;
|
|
212
212
|
}
|
|
213
|
-
function $
|
|
214
|
-
a = $
|
|
215
|
-
b = $
|
|
213
|
+
function $8180638d62fba910$export$ea840f5a6dda8147(a, b) {
|
|
214
|
+
a = $8180638d62fba910$export$f91e89d3d0406102(a);
|
|
215
|
+
b = $8180638d62fba910$export$f91e89d3d0406102(b);
|
|
216
216
|
return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year;
|
|
217
217
|
}
|
|
218
|
-
function $
|
|
219
|
-
return $
|
|
218
|
+
function $8180638d62fba910$export$629b0a497aa65267(date, timeZone) {
|
|
219
|
+
return $8180638d62fba910$export$ea39ec197993aef0(date, $8180638d62fba910$export$d0bdf45af03a6ea3(timeZone));
|
|
220
220
|
}
|
|
221
|
-
function $
|
|
221
|
+
function $8180638d62fba910$export$2061056d06d7cdf7(date, locale) {
|
|
222
222
|
let julian = date.calendar.toJulianDay(date);
|
|
223
223
|
// If julian is negative, then julian % 7 will be negative, so we adjust
|
|
224
224
|
// accordingly. Julian day 0 is Monday.
|
|
225
|
-
let dayOfWeek = Math.ceil(julian + 1 - $
|
|
225
|
+
let dayOfWeek = Math.ceil(julian + 1 - $8180638d62fba910$var$getWeekStart(locale)) % 7;
|
|
226
226
|
if (dayOfWeek < 0) dayOfWeek += 7;
|
|
227
227
|
return dayOfWeek;
|
|
228
228
|
}
|
|
229
|
-
function $
|
|
230
|
-
return $
|
|
229
|
+
function $8180638d62fba910$export$461939dd4422153(timeZone) {
|
|
230
|
+
return $6de69c682dff3674$export$1b96692a1ba042ac(Date.now(), timeZone);
|
|
231
231
|
}
|
|
232
|
-
function $
|
|
233
|
-
return $
|
|
232
|
+
function $8180638d62fba910$export$d0bdf45af03a6ea3(timeZone) {
|
|
233
|
+
return $6de69c682dff3674$export$93522d1a439f3617($8180638d62fba910$export$461939dd4422153(timeZone));
|
|
234
234
|
}
|
|
235
|
-
function $
|
|
235
|
+
function $8180638d62fba910$export$68781ddf31c0090f(a, b) {
|
|
236
236
|
return a.calendar.toJulianDay(a) - b.calendar.toJulianDay(b);
|
|
237
237
|
}
|
|
238
|
-
function $
|
|
239
|
-
return $
|
|
238
|
+
function $8180638d62fba910$export$c19a80a9721b80f6(a, b) {
|
|
239
|
+
return $8180638d62fba910$var$timeToMs(a) - $8180638d62fba910$var$timeToMs(b);
|
|
240
240
|
}
|
|
241
|
-
function $
|
|
241
|
+
function $8180638d62fba910$var$timeToMs(a) {
|
|
242
242
|
return a.hour * 3600000 + a.minute * 60000 + a.second * 1000 + a.millisecond;
|
|
243
243
|
}
|
|
244
|
-
function $
|
|
245
|
-
let ms = $
|
|
244
|
+
function $8180638d62fba910$export$126c91c941de7e(a, timeZone) {
|
|
245
|
+
let ms = $6de69c682dff3674$export$5107c82f94518f5c(a, timeZone);
|
|
246
246
|
let tomorrow = a.add({
|
|
247
247
|
days: 1
|
|
248
248
|
});
|
|
249
|
-
let tomorrowMs = $
|
|
249
|
+
let tomorrowMs = $6de69c682dff3674$export$5107c82f94518f5c(tomorrow, timeZone);
|
|
250
250
|
return (tomorrowMs - ms) / 3600000;
|
|
251
251
|
}
|
|
252
|
-
let $
|
|
253
|
-
function $
|
|
252
|
+
let $8180638d62fba910$var$localTimeZone = null;
|
|
253
|
+
function $8180638d62fba910$export$aa8b41735afcabd2() {
|
|
254
254
|
// TODO: invalidate this somehow?
|
|
255
|
-
if ($
|
|
256
|
-
return $
|
|
255
|
+
if ($8180638d62fba910$var$localTimeZone == null) $8180638d62fba910$var$localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
256
|
+
return $8180638d62fba910$var$localTimeZone;
|
|
257
257
|
}
|
|
258
|
-
function $
|
|
258
|
+
function $8180638d62fba910$export$a5a3b454ada2268e(date) {
|
|
259
259
|
// Use `subtract` instead of `set` so we don't get constrained in an era.
|
|
260
260
|
return date.subtract({
|
|
261
261
|
days: date.day - 1
|
|
262
262
|
});
|
|
263
263
|
}
|
|
264
|
-
function $
|
|
264
|
+
function $8180638d62fba910$export$a2258d9c4118825c(date) {
|
|
265
265
|
return date.add({
|
|
266
266
|
days: date.calendar.getDaysInMonth(date) - date.day
|
|
267
267
|
});
|
|
268
268
|
}
|
|
269
|
-
function $
|
|
270
|
-
return $
|
|
269
|
+
function $8180638d62fba910$export$f91e89d3d0406102(date) {
|
|
270
|
+
return $8180638d62fba910$export$a5a3b454ada2268e(date.subtract({
|
|
271
271
|
months: date.month - 1
|
|
272
272
|
}));
|
|
273
273
|
}
|
|
274
|
-
function $
|
|
275
|
-
return $
|
|
274
|
+
function $8180638d62fba910$export$8b7aa55c66d5569e(date) {
|
|
275
|
+
return $8180638d62fba910$export$a2258d9c4118825c(date.add({
|
|
276
276
|
months: date.calendar.getMonthsInYear(date) - date.month
|
|
277
277
|
}));
|
|
278
278
|
}
|
|
279
|
-
function $
|
|
279
|
+
function $8180638d62fba910$export$5412ac11713b72ad(date) {
|
|
280
280
|
if (date.calendar.getMinimumMonthInYear) return date.calendar.getMinimumMonthInYear(date);
|
|
281
281
|
return 1;
|
|
282
282
|
}
|
|
283
|
-
function $
|
|
283
|
+
function $8180638d62fba910$export$b2f4953d301981d5(date) {
|
|
284
284
|
if (date.calendar.getMinimumDayInMonth) return date.calendar.getMinimumDayInMonth(date);
|
|
285
285
|
return 1;
|
|
286
286
|
}
|
|
287
|
-
function $
|
|
288
|
-
let dayOfWeek = $
|
|
287
|
+
function $8180638d62fba910$export$42c81a444fbfb5d4(date, locale) {
|
|
288
|
+
let dayOfWeek = $8180638d62fba910$export$2061056d06d7cdf7(date, locale);
|
|
289
289
|
return date.subtract({
|
|
290
290
|
days: dayOfWeek
|
|
291
291
|
});
|
|
292
292
|
}
|
|
293
|
-
function $
|
|
294
|
-
return $
|
|
293
|
+
function $8180638d62fba910$export$ef8b6d9133084f4e(date, locale) {
|
|
294
|
+
return $8180638d62fba910$export$42c81a444fbfb5d4(date, locale).add({
|
|
295
295
|
days: 6
|
|
296
296
|
});
|
|
297
297
|
}
|
|
298
|
-
const $
|
|
299
|
-
function $
|
|
298
|
+
const $8180638d62fba910$var$cachedRegions = new Map();
|
|
299
|
+
function $8180638d62fba910$var$getRegion(locale) {
|
|
300
300
|
// If the Intl.Locale API is available, use it to get the region for the locale.
|
|
301
301
|
// @ts-ignore
|
|
302
302
|
if (Intl.Locale) {
|
|
303
303
|
// Constructing an Intl.Locale is expensive, so cache the result.
|
|
304
|
-
let region = $
|
|
304
|
+
let region = $8180638d62fba910$var$cachedRegions.get(locale);
|
|
305
305
|
if (!region) {
|
|
306
306
|
// @ts-ignore
|
|
307
307
|
region = new Intl.Locale(locale).maximize().region;
|
|
308
|
-
$
|
|
308
|
+
$8180638d62fba910$var$cachedRegions.set(locale, region);
|
|
309
309
|
}
|
|
310
310
|
return region;
|
|
311
311
|
}
|
|
@@ -316,23 +316,23 @@ function $77587dc5ead8743c$var$getRegion(locale) {
|
|
|
316
316
|
let part = locale.split('-')[1];
|
|
317
317
|
return part === 'u' ? null : part;
|
|
318
318
|
}
|
|
319
|
-
function $
|
|
319
|
+
function $8180638d62fba910$var$getWeekStart(locale) {
|
|
320
320
|
// TODO: use Intl.Locale for this once browsers support the weekInfo property
|
|
321
321
|
// https://github.com/tc39/proposal-intl-locale-info
|
|
322
|
-
let region = $
|
|
323
|
-
return $
|
|
322
|
+
let region = $8180638d62fba910$var$getRegion(locale);
|
|
323
|
+
return $580b85229f2cb211$export$7a5acbd77d414bd9[region] || 0;
|
|
324
324
|
}
|
|
325
|
-
function $
|
|
325
|
+
function $8180638d62fba910$export$ccc1b2479e7dd654(date, locale) {
|
|
326
326
|
let days = date.calendar.getDaysInMonth(date);
|
|
327
|
-
return Math.ceil(($
|
|
327
|
+
return Math.ceil(($8180638d62fba910$export$2061056d06d7cdf7($8180638d62fba910$export$a5a3b454ada2268e(date), locale) + days) / 7);
|
|
328
328
|
}
|
|
329
|
-
function $
|
|
329
|
+
function $8180638d62fba910$export$5c333a116e949cdd(a, b) {
|
|
330
330
|
return a.compare(b) <= 0 ? a : b;
|
|
331
331
|
}
|
|
332
|
-
function $
|
|
332
|
+
function $8180638d62fba910$export$a75f2bff57811055(a, b) {
|
|
333
333
|
return a.compare(b) >= 0 ? a : b;
|
|
334
334
|
}
|
|
335
|
-
const $
|
|
335
|
+
const $8180638d62fba910$var$WEEKEND_DATA = {
|
|
336
336
|
AF: [
|
|
337
337
|
4,
|
|
338
338
|
5
|
|
@@ -402,53 +402,53 @@ const $77587dc5ead8743c$var$WEEKEND_DATA = {
|
|
|
402
402
|
6
|
|
403
403
|
]
|
|
404
404
|
};
|
|
405
|
-
function $
|
|
405
|
+
function $8180638d62fba910$export$618d60ea299da42(date, locale) {
|
|
406
406
|
let julian = date.calendar.toJulianDay(date);
|
|
407
407
|
// If julian is negative, then julian % 7 will be negative, so we adjust
|
|
408
408
|
// accordingly. Julian day 0 is Monday.
|
|
409
409
|
let dayOfWeek = Math.ceil(julian + 1) % 7;
|
|
410
410
|
if (dayOfWeek < 0) dayOfWeek += 7;
|
|
411
|
-
let region = $
|
|
411
|
+
let region = $8180638d62fba910$var$getRegion(locale);
|
|
412
412
|
// Use Intl.Locale for this once weekInfo is supported.
|
|
413
413
|
// https://github.com/tc39/proposal-intl-locale-info
|
|
414
|
-
let [start, end] = $
|
|
414
|
+
let [start, end] = $8180638d62fba910$var$WEEKEND_DATA[region] || [
|
|
415
415
|
6,
|
|
416
416
|
0
|
|
417
417
|
];
|
|
418
418
|
return dayOfWeek === start || dayOfWeek === end;
|
|
419
419
|
}
|
|
420
|
-
function $
|
|
421
|
-
return !$
|
|
420
|
+
function $8180638d62fba910$export$ee9d87258e1d19ed(date, locale) {
|
|
421
|
+
return !$8180638d62fba910$export$618d60ea299da42(date, locale);
|
|
422
422
|
}
|
|
423
423
|
|
|
424
424
|
|
|
425
425
|
|
|
426
426
|
|
|
427
|
-
function $
|
|
427
|
+
function $126da7c1075fa25c$export$842a2cf37af977e1(amount, numerator) {
|
|
428
428
|
return amount - numerator * Math.floor(amount / numerator);
|
|
429
429
|
}
|
|
430
|
-
function $
|
|
431
|
-
if (date.era) return new $
|
|
432
|
-
else return new $
|
|
430
|
+
function $126da7c1075fa25c$export$784d13d8ee351f07(date) {
|
|
431
|
+
if (date.era) return new $e2d97aa3b7775168$export$99faa760c7908e4f(date.calendar, date.era, date.year, date.month, date.day);
|
|
432
|
+
else return new $e2d97aa3b7775168$export$99faa760c7908e4f(date.calendar, date.year, date.month, date.day);
|
|
433
433
|
}
|
|
434
|
-
function $
|
|
435
|
-
if (date.era) return new $
|
|
436
|
-
else return new $
|
|
434
|
+
function $126da7c1075fa25c$export$27fa0172ae2644b3(date) {
|
|
435
|
+
if (date.era) return new $e2d97aa3b7775168$export$ca871e8dbb80966f(date.calendar, date.era, date.year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
|
|
436
|
+
else return new $e2d97aa3b7775168$export$ca871e8dbb80966f(date.calendar, date.year, date.month, date.day, date.hour, date.minute, date.second);
|
|
437
437
|
}
|
|
438
438
|
|
|
439
439
|
|
|
440
|
-
const $
|
|
441
|
-
function $
|
|
440
|
+
const $680b26d521b88d00$var$EPOCH = 1721426; // 001/01/03 Julian C.E.
|
|
441
|
+
function $680b26d521b88d00$export$f297eb839006d339(year, month, day) {
|
|
442
442
|
let y1 = year - 1;
|
|
443
443
|
let monthOffset = -2;
|
|
444
444
|
if (month <= 2) monthOffset = 0;
|
|
445
|
-
else if ($
|
|
446
|
-
return $
|
|
445
|
+
else if ($680b26d521b88d00$export$553d7fa8e3805fc0(year)) monthOffset = -1;
|
|
446
|
+
return $680b26d521b88d00$var$EPOCH - 1 + 365 * y1 + Math.floor(y1 / 4) - Math.floor(y1 / 100) + Math.floor(y1 / 400) + Math.floor((367 * month - 362) / 12 + monthOffset + day);
|
|
447
447
|
}
|
|
448
|
-
function $
|
|
448
|
+
function $680b26d521b88d00$export$553d7fa8e3805fc0(year) {
|
|
449
449
|
return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
450
450
|
}
|
|
451
|
-
const $
|
|
451
|
+
const $680b26d521b88d00$var$daysInMonth = {
|
|
452
452
|
standard: [
|
|
453
453
|
31,
|
|
454
454
|
28,
|
|
@@ -478,38 +478,38 @@ const $5adb4cba079e6f7b$var$daysInMonth = {
|
|
|
478
478
|
31
|
|
479
479
|
]
|
|
480
480
|
};
|
|
481
|
-
class $
|
|
481
|
+
class $680b26d521b88d00$export$80ee6245ec4f29ec {
|
|
482
482
|
fromJulianDay(jd) {
|
|
483
483
|
let jd0 = jd;
|
|
484
|
-
let depoch = jd0 - $
|
|
484
|
+
let depoch = jd0 - $680b26d521b88d00$var$EPOCH;
|
|
485
485
|
let quadricent = Math.floor(depoch / 146097);
|
|
486
|
-
let dqc = $
|
|
486
|
+
let dqc = $126da7c1075fa25c$export$842a2cf37af977e1(depoch, 146097);
|
|
487
487
|
let cent = Math.floor(dqc / 36524);
|
|
488
|
-
let dcent = $
|
|
488
|
+
let dcent = $126da7c1075fa25c$export$842a2cf37af977e1(dqc, 36524);
|
|
489
489
|
let quad = Math.floor(dcent / 1461);
|
|
490
|
-
let dquad = $
|
|
490
|
+
let dquad = $126da7c1075fa25c$export$842a2cf37af977e1(dcent, 1461);
|
|
491
491
|
let yindex = Math.floor(dquad / 365);
|
|
492
492
|
let year = quadricent * 400 + cent * 100 + quad * 4 + yindex + (cent !== 4 && yindex !== 4 ? 1 : 0);
|
|
493
|
-
let yearDay = jd0 - $
|
|
493
|
+
let yearDay = jd0 - $680b26d521b88d00$export$f297eb839006d339(year, 1, 1);
|
|
494
494
|
let leapAdj = 2;
|
|
495
|
-
if (jd0 < $
|
|
496
|
-
else if ($
|
|
495
|
+
if (jd0 < $680b26d521b88d00$export$f297eb839006d339(year, 3, 1)) leapAdj = 0;
|
|
496
|
+
else if ($680b26d521b88d00$export$553d7fa8e3805fc0(year)) leapAdj = 1;
|
|
497
497
|
let month = Math.floor(((yearDay + leapAdj) * 12 + 373) / 367);
|
|
498
|
-
let day = jd0 - $
|
|
499
|
-
return new $
|
|
498
|
+
let day = jd0 - $680b26d521b88d00$export$f297eb839006d339(year, month, 1) + 1;
|
|
499
|
+
return new $e2d97aa3b7775168$export$99faa760c7908e4f(this, year, month, day);
|
|
500
500
|
}
|
|
501
501
|
toJulianDay(date) {
|
|
502
|
-
return $
|
|
502
|
+
return $680b26d521b88d00$export$f297eb839006d339(date.year, date.month, date.day);
|
|
503
503
|
}
|
|
504
504
|
getDaysInMonth(date) {
|
|
505
|
-
return $
|
|
505
|
+
return $680b26d521b88d00$var$daysInMonth[$680b26d521b88d00$export$553d7fa8e3805fc0(date.year) ? 'leapyear' : 'standard'][date.month - 1];
|
|
506
506
|
}
|
|
507
507
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
508
508
|
getMonthsInYear(date) {
|
|
509
509
|
return 12;
|
|
510
510
|
}
|
|
511
511
|
getDaysInYear(date) {
|
|
512
|
-
return $
|
|
512
|
+
return $680b26d521b88d00$export$553d7fa8e3805fc0(date.year) ? 366 : 365;
|
|
513
513
|
}
|
|
514
514
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
515
515
|
getYearsInEra(date) {
|
|
@@ -536,11 +536,11 @@ class $5adb4cba079e6f7b$export$80ee6245ec4f29ec {
|
|
|
536
536
|
}
|
|
537
537
|
|
|
538
538
|
|
|
539
|
-
function $
|
|
540
|
-
date = $
|
|
541
|
-
return $
|
|
539
|
+
function $6de69c682dff3674$export$bd4fb2bc8bb06fb(date) {
|
|
540
|
+
date = $6de69c682dff3674$export$b4a036af3fc0b032(date, new $680b26d521b88d00$export$80ee6245ec4f29ec());
|
|
541
|
+
return $6de69c682dff3674$var$epochFromParts(date.year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
|
|
542
542
|
}
|
|
543
|
-
function $
|
|
543
|
+
function $6de69c682dff3674$var$epochFromParts(year, month, day, hour, minute, second, millisecond) {
|
|
544
544
|
// Note: Date.UTC() interprets one and two-digit years as being in the
|
|
545
545
|
// 20th century, so don't use it
|
|
546
546
|
let date = new Date();
|
|
@@ -548,16 +548,16 @@ function $1842b789961e6c21$var$epochFromParts(year, month, day, hour, minute, se
|
|
|
548
548
|
date.setUTCFullYear(year, month - 1, day);
|
|
549
549
|
return date.getTime();
|
|
550
550
|
}
|
|
551
|
-
function $
|
|
551
|
+
function $6de69c682dff3674$export$59c99f3515d3493f(ms, timeZone) {
|
|
552
552
|
// Fast path: for local timezone, use native Date.
|
|
553
|
-
if (timeZone === $
|
|
554
|
-
let { year: year , month: month , day: day , hour: hour , minute: minute , second: second } = $
|
|
555
|
-
let utc = $
|
|
553
|
+
if (timeZone === $8180638d62fba910$export$aa8b41735afcabd2()) return new Date(ms).getTimezoneOffset() * -60000;
|
|
554
|
+
let { year: year , month: month , day: day , hour: hour , minute: minute , second: second } = $6de69c682dff3674$var$getTimeZoneParts(ms, timeZone);
|
|
555
|
+
let utc = $6de69c682dff3674$var$epochFromParts(year, month, day, hour, minute, second, 0);
|
|
556
556
|
return utc - Math.floor(ms / 1000) * 1000;
|
|
557
557
|
}
|
|
558
|
-
const $
|
|
559
|
-
function $
|
|
560
|
-
let formatter = $
|
|
558
|
+
const $6de69c682dff3674$var$formattersByTimeZone = new Map();
|
|
559
|
+
function $6de69c682dff3674$var$getTimeZoneParts(ms, timeZone) {
|
|
560
|
+
let formatter = $6de69c682dff3674$var$formattersByTimeZone.get(timeZone);
|
|
561
561
|
if (!formatter) {
|
|
562
562
|
formatter = new Intl.DateTimeFormat('en-US', {
|
|
563
563
|
timeZone: timeZone,
|
|
@@ -570,7 +570,7 @@ function $1842b789961e6c21$var$getTimeZoneParts(ms, timeZone) {
|
|
|
570
570
|
minute: 'numeric',
|
|
571
571
|
second: 'numeric'
|
|
572
572
|
});
|
|
573
|
-
$
|
|
573
|
+
$6de69c682dff3674$var$formattersByTimeZone.set(timeZone, formatter);
|
|
574
574
|
}
|
|
575
575
|
let parts = formatter.formatToParts(new Date(ms));
|
|
576
576
|
let namedParts = {
|
|
@@ -585,42 +585,42 @@ function $1842b789961e6c21$var$getTimeZoneParts(ms, timeZone) {
|
|
|
585
585
|
second: +namedParts.second
|
|
586
586
|
};
|
|
587
587
|
}
|
|
588
|
-
const $
|
|
589
|
-
function $
|
|
590
|
-
let ms = $
|
|
591
|
-
let earlier = ms - $
|
|
592
|
-
let later = ms - $
|
|
593
|
-
return $
|
|
588
|
+
const $6de69c682dff3674$var$DAYMILLIS = 86400000;
|
|
589
|
+
function $6de69c682dff3674$export$136f38efe7caf549(date, timeZone) {
|
|
590
|
+
let ms = $6de69c682dff3674$export$bd4fb2bc8bb06fb(date);
|
|
591
|
+
let earlier = ms - $6de69c682dff3674$export$59c99f3515d3493f(ms - $6de69c682dff3674$var$DAYMILLIS, timeZone);
|
|
592
|
+
let later = ms - $6de69c682dff3674$export$59c99f3515d3493f(ms + $6de69c682dff3674$var$DAYMILLIS, timeZone);
|
|
593
|
+
return $6de69c682dff3674$var$getValidWallTimes(date, timeZone, earlier, later);
|
|
594
594
|
}
|
|
595
|
-
function $
|
|
595
|
+
function $6de69c682dff3674$var$getValidWallTimes(date, timeZone, earlier, later) {
|
|
596
596
|
let found = earlier === later ? [
|
|
597
597
|
earlier
|
|
598
598
|
] : [
|
|
599
599
|
earlier,
|
|
600
600
|
later
|
|
601
601
|
];
|
|
602
|
-
return found.filter((absolute)=>$
|
|
602
|
+
return found.filter((absolute)=>$6de69c682dff3674$var$isValidWallTime(date, timeZone, absolute)
|
|
603
603
|
);
|
|
604
604
|
}
|
|
605
|
-
function $
|
|
606
|
-
let parts = $
|
|
605
|
+
function $6de69c682dff3674$var$isValidWallTime(date, timeZone, absolute) {
|
|
606
|
+
let parts = $6de69c682dff3674$var$getTimeZoneParts(absolute, timeZone);
|
|
607
607
|
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;
|
|
608
608
|
}
|
|
609
|
-
function $
|
|
610
|
-
let dateTime = $
|
|
609
|
+
function $6de69c682dff3674$export$5107c82f94518f5c(date, timeZone, disambiguation = 'compatible') {
|
|
610
|
+
let dateTime = $6de69c682dff3674$export$b21e0b124e224484(date);
|
|
611
611
|
// Fast path: if the time zone is the local timezone and disambiguation is compatible, use native Date.
|
|
612
|
-
if (timeZone === $
|
|
613
|
-
dateTime = $
|
|
612
|
+
if (timeZone === $8180638d62fba910$export$aa8b41735afcabd2() && disambiguation === 'compatible') {
|
|
613
|
+
dateTime = $6de69c682dff3674$export$b4a036af3fc0b032(dateTime, new $680b26d521b88d00$export$80ee6245ec4f29ec());
|
|
614
614
|
// Don't use Date constructor here because two-digit years are interpreted in the 20th century.
|
|
615
615
|
let date = new Date();
|
|
616
616
|
date.setFullYear(dateTime.year, dateTime.month - 1, dateTime.day);
|
|
617
617
|
date.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
|
|
618
618
|
return date.getTime();
|
|
619
619
|
}
|
|
620
|
-
let ms = $
|
|
621
|
-
let offsetBefore = $
|
|
622
|
-
let offsetAfter = $
|
|
623
|
-
let valid = $
|
|
620
|
+
let ms = $6de69c682dff3674$export$bd4fb2bc8bb06fb(dateTime);
|
|
621
|
+
let offsetBefore = $6de69c682dff3674$export$59c99f3515d3493f(ms - $6de69c682dff3674$var$DAYMILLIS, timeZone);
|
|
622
|
+
let offsetAfter = $6de69c682dff3674$export$59c99f3515d3493f(ms + $6de69c682dff3674$var$DAYMILLIS, timeZone);
|
|
623
|
+
let valid = $6de69c682dff3674$var$getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);
|
|
624
624
|
if (valid.length === 1) return valid[0];
|
|
625
625
|
if (valid.length > 1) switch(disambiguation){
|
|
626
626
|
// 'compatible' means 'earlier' for "fall back" transitions
|
|
@@ -643,11 +643,11 @@ function $1842b789961e6c21$export$5107c82f94518f5c(date, timeZone, disambiguatio
|
|
|
643
643
|
throw new RangeError('No such absolute time found');
|
|
644
644
|
}
|
|
645
645
|
}
|
|
646
|
-
function $
|
|
647
|
-
return new Date($
|
|
646
|
+
function $6de69c682dff3674$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = 'compatible') {
|
|
647
|
+
return new Date($6de69c682dff3674$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));
|
|
648
648
|
}
|
|
649
|
-
function $
|
|
650
|
-
let offset = $
|
|
649
|
+
function $6de69c682dff3674$export$1b96692a1ba042ac(ms, timeZone) {
|
|
650
|
+
let offset = $6de69c682dff3674$export$59c99f3515d3493f(ms, timeZone);
|
|
651
651
|
let date = new Date(ms + offset);
|
|
652
652
|
let year = date.getUTCFullYear();
|
|
653
653
|
let month = date.getUTCMonth() + 1;
|
|
@@ -656,18 +656,18 @@ function $1842b789961e6c21$export$1b96692a1ba042ac(ms, timeZone) {
|
|
|
656
656
|
let minute = date.getUTCMinutes();
|
|
657
657
|
let second = date.getUTCSeconds();
|
|
658
658
|
let millisecond = date.getUTCMilliseconds();
|
|
659
|
-
return new $
|
|
659
|
+
return new $e2d97aa3b7775168$export$d3b7288e7994edea(year, month, day, timeZone, offset, hour, minute, second, millisecond);
|
|
660
660
|
}
|
|
661
|
-
function $
|
|
662
|
-
return $
|
|
661
|
+
function $6de69c682dff3674$export$e57ff100d91bd4b9(date, timeZone) {
|
|
662
|
+
return $6de69c682dff3674$export$1b96692a1ba042ac(date.getTime(), timeZone);
|
|
663
663
|
}
|
|
664
|
-
function $
|
|
665
|
-
return $
|
|
664
|
+
function $6de69c682dff3674$export$d7f92bcd3596b086(date) {
|
|
665
|
+
return $6de69c682dff3674$export$e57ff100d91bd4b9(date, $8180638d62fba910$export$aa8b41735afcabd2());
|
|
666
666
|
}
|
|
667
|
-
function $
|
|
668
|
-
return new $
|
|
667
|
+
function $6de69c682dff3674$export$93522d1a439f3617(dateTime) {
|
|
668
|
+
return new $e2d97aa3b7775168$export$99faa760c7908e4f(dateTime.calendar, dateTime.era, dateTime.year, dateTime.month, dateTime.day);
|
|
669
669
|
}
|
|
670
|
-
function $
|
|
670
|
+
function $6de69c682dff3674$export$6f4d78149f3f53ac(date) {
|
|
671
671
|
return {
|
|
672
672
|
era: date.era,
|
|
673
673
|
year: date.year,
|
|
@@ -675,7 +675,7 @@ function $1842b789961e6c21$export$6f4d78149f3f53ac(date) {
|
|
|
675
675
|
day: date.day
|
|
676
676
|
};
|
|
677
677
|
}
|
|
678
|
-
function $
|
|
678
|
+
function $6de69c682dff3674$export$4d0393e732857be5(date) {
|
|
679
679
|
return {
|
|
680
680
|
hour: date.hour,
|
|
681
681
|
minute: date.minute,
|
|
@@ -683,17 +683,17 @@ function $1842b789961e6c21$export$4d0393e732857be5(date) {
|
|
|
683
683
|
millisecond: date.millisecond
|
|
684
684
|
};
|
|
685
685
|
}
|
|
686
|
-
function $
|
|
686
|
+
function $6de69c682dff3674$export$b21e0b124e224484(date, time) {
|
|
687
687
|
let hour = 0, minute = 0, second = 0, millisecond = 0;
|
|
688
688
|
if ('timeZone' in date) ({ hour: hour , minute: minute , second: second , millisecond: millisecond } = date);
|
|
689
689
|
else if ('hour' in date && !time) return date;
|
|
690
690
|
if (time) ({ hour: hour , minute: minute , second: second , millisecond: millisecond } = time);
|
|
691
|
-
return new $
|
|
691
|
+
return new $e2d97aa3b7775168$export$ca871e8dbb80966f(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);
|
|
692
692
|
}
|
|
693
|
-
function $
|
|
694
|
-
return new $
|
|
693
|
+
function $6de69c682dff3674$export$d33f79e3ffc3dc83(dateTime) {
|
|
694
|
+
return new $e2d97aa3b7775168$export$680ea196effce5f(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
|
|
695
695
|
}
|
|
696
|
-
function $
|
|
696
|
+
function $6de69c682dff3674$export$b4a036af3fc0b032(date, calendar) {
|
|
697
697
|
if (date.calendar.identifier === calendar.identifier) return date;
|
|
698
698
|
let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));
|
|
699
699
|
let copy = date.copy();
|
|
@@ -704,145 +704,145 @@ function $1842b789961e6c21$export$b4a036af3fc0b032(date, calendar) {
|
|
|
704
704
|
copy.day = calendarDate.day;
|
|
705
705
|
return copy;
|
|
706
706
|
}
|
|
707
|
-
function $
|
|
708
|
-
if (date instanceof $
|
|
707
|
+
function $6de69c682dff3674$export$84c95a83c799e074(date, timeZone, disambiguation) {
|
|
708
|
+
if (date instanceof $e2d97aa3b7775168$export$d3b7288e7994edea) {
|
|
709
709
|
if (date.timeZone === timeZone) return date;
|
|
710
|
-
return $
|
|
710
|
+
return $6de69c682dff3674$export$538b00033cc11c75(date, timeZone);
|
|
711
711
|
}
|
|
712
|
-
let ms = $
|
|
713
|
-
return $
|
|
712
|
+
let ms = $6de69c682dff3674$export$5107c82f94518f5c(date, timeZone, disambiguation);
|
|
713
|
+
return $6de69c682dff3674$export$1b96692a1ba042ac(ms, timeZone);
|
|
714
714
|
}
|
|
715
|
-
function $
|
|
716
|
-
let ms = $
|
|
715
|
+
function $6de69c682dff3674$export$83aac07b4c37b25(date) {
|
|
716
|
+
let ms = $6de69c682dff3674$export$bd4fb2bc8bb06fb(date) - date.offset;
|
|
717
717
|
return new Date(ms);
|
|
718
718
|
}
|
|
719
|
-
function $
|
|
720
|
-
let ms = $
|
|
721
|
-
return $
|
|
719
|
+
function $6de69c682dff3674$export$538b00033cc11c75(date, timeZone) {
|
|
720
|
+
let ms = $6de69c682dff3674$export$bd4fb2bc8bb06fb(date) - date.offset;
|
|
721
|
+
return $6de69c682dff3674$export$b4a036af3fc0b032($6de69c682dff3674$export$1b96692a1ba042ac(ms, timeZone), date.calendar);
|
|
722
722
|
}
|
|
723
|
-
function $
|
|
724
|
-
return $
|
|
723
|
+
function $6de69c682dff3674$export$d9b67bc93c097491(date) {
|
|
724
|
+
return $6de69c682dff3674$export$538b00033cc11c75(date, $8180638d62fba910$export$aa8b41735afcabd2());
|
|
725
725
|
}
|
|
726
726
|
|
|
727
727
|
|
|
728
728
|
|
|
729
|
-
const $
|
|
730
|
-
function $
|
|
729
|
+
const $b795f1a945a78ee3$var$ONE_HOUR = 3600000;
|
|
730
|
+
function $b795f1a945a78ee3$export$e16d8520af44a096(date, duration) {
|
|
731
731
|
let mutableDate = date.copy();
|
|
732
|
-
let days = 'hour' in date ? $
|
|
733
|
-
$
|
|
732
|
+
let days = 'hour' in date ? $b795f1a945a78ee3$var$addTimeFields(date, duration) : 0;
|
|
733
|
+
$b795f1a945a78ee3$var$addYears(mutableDate, duration.years || 0);
|
|
734
734
|
if (mutableDate.calendar.balanceYearMonth) mutableDate.calendar.balanceYearMonth(mutableDate, date);
|
|
735
735
|
mutableDate.month += duration.months || 0;
|
|
736
|
-
$
|
|
737
|
-
$
|
|
736
|
+
$b795f1a945a78ee3$var$balanceYearMonth(mutableDate);
|
|
737
|
+
$b795f1a945a78ee3$var$constrainMonthDay(mutableDate);
|
|
738
738
|
mutableDate.day += (duration.weeks || 0) * 7;
|
|
739
739
|
mutableDate.day += duration.days || 0;
|
|
740
740
|
mutableDate.day += days;
|
|
741
|
-
$
|
|
741
|
+
$b795f1a945a78ee3$var$balanceDay(mutableDate);
|
|
742
742
|
if (mutableDate.calendar.balanceDate) mutableDate.calendar.balanceDate(mutableDate);
|
|
743
743
|
return mutableDate;
|
|
744
744
|
}
|
|
745
|
-
function $
|
|
745
|
+
function $b795f1a945a78ee3$var$addYears(date, years) {
|
|
746
746
|
if (date.calendar.getYearsToAdd) years = date.calendar.getYearsToAdd(date, years);
|
|
747
747
|
date.year += years;
|
|
748
748
|
}
|
|
749
|
-
function $
|
|
749
|
+
function $b795f1a945a78ee3$var$balanceYearMonth(date) {
|
|
750
750
|
while(date.month < 1){
|
|
751
|
-
$
|
|
751
|
+
$b795f1a945a78ee3$var$addYears(date, -1);
|
|
752
752
|
date.month += date.calendar.getMonthsInYear(date);
|
|
753
753
|
}
|
|
754
754
|
let monthsInYear = 0;
|
|
755
755
|
while(date.month > (monthsInYear = date.calendar.getMonthsInYear(date))){
|
|
756
756
|
date.month -= monthsInYear;
|
|
757
|
-
$
|
|
757
|
+
$b795f1a945a78ee3$var$addYears(date, 1);
|
|
758
758
|
}
|
|
759
759
|
}
|
|
760
|
-
function $
|
|
760
|
+
function $b795f1a945a78ee3$var$balanceDay(date) {
|
|
761
761
|
while(date.day < 1){
|
|
762
762
|
date.month--;
|
|
763
|
-
$
|
|
763
|
+
$b795f1a945a78ee3$var$balanceYearMonth(date);
|
|
764
764
|
date.day += date.calendar.getDaysInMonth(date);
|
|
765
765
|
}
|
|
766
766
|
while(date.day > date.calendar.getDaysInMonth(date)){
|
|
767
767
|
date.day -= date.calendar.getDaysInMonth(date);
|
|
768
768
|
date.month++;
|
|
769
|
-
$
|
|
769
|
+
$b795f1a945a78ee3$var$balanceYearMonth(date);
|
|
770
770
|
}
|
|
771
771
|
}
|
|
772
|
-
function $
|
|
772
|
+
function $b795f1a945a78ee3$var$constrainMonthDay(date) {
|
|
773
773
|
date.month = Math.max(1, Math.min(date.calendar.getMonthsInYear(date), date.month));
|
|
774
774
|
date.day = Math.max(1, Math.min(date.calendar.getDaysInMonth(date), date.day));
|
|
775
775
|
}
|
|
776
|
-
function $
|
|
776
|
+
function $b795f1a945a78ee3$export$c4e2ecac49351ef2(date) {
|
|
777
777
|
if (date.calendar.constrainDate) date.calendar.constrainDate(date);
|
|
778
778
|
date.year = Math.max(1, Math.min(date.calendar.getYearsInEra(date), date.year));
|
|
779
|
-
$
|
|
779
|
+
$b795f1a945a78ee3$var$constrainMonthDay(date);
|
|
780
780
|
}
|
|
781
|
-
function $
|
|
781
|
+
function $b795f1a945a78ee3$export$3e2544e88a25bff8(duration) {
|
|
782
782
|
let inverseDuration = {
|
|
783
783
|
};
|
|
784
784
|
for(let key in duration)if (typeof duration[key] === 'number') inverseDuration[key] = -duration[key];
|
|
785
785
|
return inverseDuration;
|
|
786
786
|
}
|
|
787
|
-
function $
|
|
788
|
-
return $
|
|
787
|
+
function $b795f1a945a78ee3$export$4e2d2ead65e5f7e3(date, duration) {
|
|
788
|
+
return $b795f1a945a78ee3$export$e16d8520af44a096(date, $b795f1a945a78ee3$export$3e2544e88a25bff8(duration));
|
|
789
789
|
}
|
|
790
|
-
function $
|
|
790
|
+
function $b795f1a945a78ee3$export$adaa4cf7ef1b65be(date, fields) {
|
|
791
791
|
let mutableDate = date.copy();
|
|
792
792
|
if (fields.era != null) mutableDate.era = fields.era;
|
|
793
793
|
if (fields.year != null) mutableDate.year = fields.year;
|
|
794
794
|
if (fields.month != null) mutableDate.month = fields.month;
|
|
795
795
|
if (fields.day != null) mutableDate.day = fields.day;
|
|
796
|
-
$
|
|
796
|
+
$b795f1a945a78ee3$export$c4e2ecac49351ef2(mutableDate);
|
|
797
797
|
return mutableDate;
|
|
798
798
|
}
|
|
799
|
-
function $
|
|
799
|
+
function $b795f1a945a78ee3$export$e5d5e1c1822b6e56(value, fields) {
|
|
800
800
|
let mutableValue = value.copy();
|
|
801
801
|
if (fields.hour != null) mutableValue.hour = fields.hour;
|
|
802
802
|
if (fields.minute != null) mutableValue.minute = fields.minute;
|
|
803
803
|
if (fields.second != null) mutableValue.second = fields.second;
|
|
804
804
|
if (fields.millisecond != null) mutableValue.millisecond = fields.millisecond;
|
|
805
|
-
$
|
|
805
|
+
$b795f1a945a78ee3$export$7555de1e070510cb(mutableValue);
|
|
806
806
|
return mutableValue;
|
|
807
807
|
}
|
|
808
|
-
function $
|
|
808
|
+
function $b795f1a945a78ee3$var$balanceTime(time) {
|
|
809
809
|
time.second += Math.floor(time.millisecond / 1000);
|
|
810
|
-
time.millisecond = $
|
|
810
|
+
time.millisecond = $b795f1a945a78ee3$var$nonNegativeMod(time.millisecond, 1000);
|
|
811
811
|
time.minute += Math.floor(time.second / 60);
|
|
812
|
-
time.second = $
|
|
812
|
+
time.second = $b795f1a945a78ee3$var$nonNegativeMod(time.second, 60);
|
|
813
813
|
time.hour += Math.floor(time.minute / 60);
|
|
814
|
-
time.minute = $
|
|
814
|
+
time.minute = $b795f1a945a78ee3$var$nonNegativeMod(time.minute, 60);
|
|
815
815
|
let days = Math.floor(time.hour / 24);
|
|
816
|
-
time.hour = $
|
|
816
|
+
time.hour = $b795f1a945a78ee3$var$nonNegativeMod(time.hour, 24);
|
|
817
817
|
return days;
|
|
818
818
|
}
|
|
819
|
-
function $
|
|
819
|
+
function $b795f1a945a78ee3$export$7555de1e070510cb(time) {
|
|
820
820
|
time.millisecond = Math.max(0, Math.min(time.millisecond, 1000));
|
|
821
821
|
time.second = Math.max(0, Math.min(time.second, 59));
|
|
822
822
|
time.minute = Math.max(0, Math.min(time.minute, 59));
|
|
823
823
|
time.hour = Math.max(0, Math.min(time.hour, 23));
|
|
824
824
|
}
|
|
825
|
-
function $
|
|
825
|
+
function $b795f1a945a78ee3$var$nonNegativeMod(a, b) {
|
|
826
826
|
let result = a % b;
|
|
827
827
|
if (result < 0) result += b;
|
|
828
828
|
return result;
|
|
829
829
|
}
|
|
830
|
-
function $
|
|
830
|
+
function $b795f1a945a78ee3$var$addTimeFields(time, duration) {
|
|
831
831
|
time.hour += duration.hours || 0;
|
|
832
832
|
time.minute += duration.minutes || 0;
|
|
833
833
|
time.second += duration.seconds || 0;
|
|
834
834
|
time.millisecond += duration.milliseconds || 0;
|
|
835
|
-
return $
|
|
835
|
+
return $b795f1a945a78ee3$var$balanceTime(time);
|
|
836
836
|
}
|
|
837
|
-
function $
|
|
837
|
+
function $b795f1a945a78ee3$export$7ed87b6bc2506470(time, duration) {
|
|
838
838
|
let res = time.copy();
|
|
839
|
-
$
|
|
839
|
+
$b795f1a945a78ee3$var$addTimeFields(res, duration);
|
|
840
840
|
return res;
|
|
841
841
|
}
|
|
842
|
-
function $
|
|
843
|
-
return $
|
|
842
|
+
function $b795f1a945a78ee3$export$fe34d3a381cd7501(time, duration) {
|
|
843
|
+
return $b795f1a945a78ee3$export$7ed87b6bc2506470(time, $b795f1a945a78ee3$export$3e2544e88a25bff8(duration));
|
|
844
844
|
}
|
|
845
|
-
function $
|
|
845
|
+
function $b795f1a945a78ee3$export$d52ced6badfb9a4c(value, field, amount, options) {
|
|
846
846
|
let mutable = value.copy();
|
|
847
847
|
switch(field){
|
|
848
848
|
case 'era':
|
|
@@ -850,10 +850,10 @@ function $2ae8fe19e7cd4af8$export$d52ced6badfb9a4c(value, field, amount, options
|
|
|
850
850
|
let eras = value.calendar.getEras();
|
|
851
851
|
let eraIndex = eras.indexOf(value.era);
|
|
852
852
|
if (eraIndex < 0) throw new Error('Invalid era: ' + value.era);
|
|
853
|
-
eraIndex = $
|
|
853
|
+
eraIndex = $b795f1a945a78ee3$var$cycleValue(eraIndex, amount, 0, eras.length - 1, options === null || options === void 0 ? void 0 : options.round);
|
|
854
854
|
mutable.era = eras[eraIndex];
|
|
855
855
|
// Constrain the year and other fields within the era, so the era doesn't change when we balance below.
|
|
856
|
-
$
|
|
856
|
+
$b795f1a945a78ee3$export$c4e2ecac49351ef2(mutable);
|
|
857
857
|
break;
|
|
858
858
|
}
|
|
859
859
|
case 'year':
|
|
@@ -861,24 +861,24 @@ function $2ae8fe19e7cd4af8$export$d52ced6badfb9a4c(value, field, amount, options
|
|
|
861
861
|
// The year field should not cycle within the era as that can cause weird behavior affecting other fields.
|
|
862
862
|
// We need to also allow values < 1 so that decrementing goes to the previous era. If we get -Infinity back
|
|
863
863
|
// we know we wrapped around after reaching 9999 (the maximum), so set the year back to 1.
|
|
864
|
-
mutable.year = $
|
|
864
|
+
mutable.year = $b795f1a945a78ee3$var$cycleValue(value.year, amount, -Infinity, 9999, options === null || options === void 0 ? void 0 : options.round);
|
|
865
865
|
if (mutable.year === -Infinity) mutable.year = 1;
|
|
866
866
|
if (mutable.calendar.balanceYearMonth) mutable.calendar.balanceYearMonth(mutable, value);
|
|
867
867
|
break;
|
|
868
868
|
case 'month':
|
|
869
|
-
mutable.month = $
|
|
869
|
+
mutable.month = $b795f1a945a78ee3$var$cycleValue(value.month, amount, 1, value.calendar.getMonthsInYear(value), options === null || options === void 0 ? void 0 : options.round);
|
|
870
870
|
break;
|
|
871
871
|
case 'day':
|
|
872
|
-
mutable.day = $
|
|
872
|
+
mutable.day = $b795f1a945a78ee3$var$cycleValue(value.day, amount, 1, value.calendar.getDaysInMonth(value), options === null || options === void 0 ? void 0 : options.round);
|
|
873
873
|
break;
|
|
874
874
|
default:
|
|
875
875
|
throw new Error('Unsupported field ' + field);
|
|
876
876
|
}
|
|
877
877
|
if (value.calendar.balanceDate) value.calendar.balanceDate(mutable);
|
|
878
|
-
$
|
|
878
|
+
$b795f1a945a78ee3$export$c4e2ecac49351ef2(mutable);
|
|
879
879
|
return mutable;
|
|
880
880
|
}
|
|
881
|
-
function $
|
|
881
|
+
function $b795f1a945a78ee3$export$dd02b3e0007dfe28(value, field, amount, options) {
|
|
882
882
|
let mutable = value.copy();
|
|
883
883
|
switch(field){
|
|
884
884
|
case 'hour':
|
|
@@ -886,29 +886,29 @@ function $2ae8fe19e7cd4af8$export$dd02b3e0007dfe28(value, field, amount, options
|
|
|
886
886
|
let hours = value.hour;
|
|
887
887
|
let min = 0;
|
|
888
888
|
let max = 23;
|
|
889
|
-
if (options
|
|
889
|
+
if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
|
|
890
890
|
let isPM = hours >= 12;
|
|
891
891
|
min = isPM ? 12 : 0;
|
|
892
892
|
max = isPM ? 23 : 11;
|
|
893
893
|
}
|
|
894
|
-
mutable.hour = $
|
|
894
|
+
mutable.hour = $b795f1a945a78ee3$var$cycleValue(hours, amount, min, max, options === null || options === void 0 ? void 0 : options.round);
|
|
895
895
|
break;
|
|
896
896
|
}
|
|
897
897
|
case 'minute':
|
|
898
|
-
mutable.minute = $
|
|
898
|
+
mutable.minute = $b795f1a945a78ee3$var$cycleValue(value.minute, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
|
|
899
899
|
break;
|
|
900
900
|
case 'second':
|
|
901
|
-
mutable.second = $
|
|
901
|
+
mutable.second = $b795f1a945a78ee3$var$cycleValue(value.second, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
|
|
902
902
|
break;
|
|
903
903
|
case 'millisecond':
|
|
904
|
-
mutable.millisecond = $
|
|
904
|
+
mutable.millisecond = $b795f1a945a78ee3$var$cycleValue(value.millisecond, amount, 0, 999, options === null || options === void 0 ? void 0 : options.round);
|
|
905
905
|
break;
|
|
906
906
|
default:
|
|
907
907
|
throw new Error('Unsupported field ' + field);
|
|
908
908
|
}
|
|
909
909
|
return mutable;
|
|
910
910
|
}
|
|
911
|
-
function $
|
|
911
|
+
function $b795f1a945a78ee3$var$cycleValue(value, amount, min, max, round = false) {
|
|
912
912
|
if (round) {
|
|
913
913
|
value += Math.sign(amount);
|
|
914
914
|
if (value < min) value = max;
|
|
@@ -923,19 +923,19 @@ function $2ae8fe19e7cd4af8$var$cycleValue(value, amount, min, max, round = false
|
|
|
923
923
|
}
|
|
924
924
|
return value;
|
|
925
925
|
}
|
|
926
|
-
function $
|
|
926
|
+
function $b795f1a945a78ee3$export$96b1d28349274637(dateTime, duration) {
|
|
927
927
|
let ms;
|
|
928
928
|
if (duration.years != null && duration.years !== 0 || duration.months != null && duration.months !== 0 || duration.days != null && duration.days !== 0) {
|
|
929
|
-
let res = $
|
|
929
|
+
let res = $b795f1a945a78ee3$export$e16d8520af44a096($6de69c682dff3674$export$b21e0b124e224484(dateTime), {
|
|
930
930
|
years: duration.years,
|
|
931
931
|
months: duration.months,
|
|
932
932
|
days: duration.days
|
|
933
933
|
});
|
|
934
934
|
// Changing the date may change the timezone offset, so we need to recompute
|
|
935
935
|
// using the 'compatible' disambiguation.
|
|
936
|
-
ms = $
|
|
936
|
+
ms = $6de69c682dff3674$export$5107c82f94518f5c(res, dateTime.timeZone);
|
|
937
937
|
} else // Otherwise, preserve the offset of the original date.
|
|
938
|
-
ms = $
|
|
938
|
+
ms = $6de69c682dff3674$export$bd4fb2bc8bb06fb(dateTime) - dateTime.offset;
|
|
939
939
|
// Perform time manipulation in milliseconds rather than on the original time fields to account for DST.
|
|
940
940
|
// For example, adding one hour during a DST transition may result in the hour field staying the same or
|
|
941
941
|
// skipping an hour. This results in the offset field changing value instead of the specified field.
|
|
@@ -943,13 +943,13 @@ function $2ae8fe19e7cd4af8$export$96b1d28349274637(dateTime, duration) {
|
|
|
943
943
|
ms += (duration.seconds || 0) * 1000;
|
|
944
944
|
ms += (duration.minutes || 0) * 60000;
|
|
945
945
|
ms += (duration.hours || 0) * 3600000;
|
|
946
|
-
let res = $
|
|
947
|
-
return $
|
|
946
|
+
let res = $6de69c682dff3674$export$1b96692a1ba042ac(ms, dateTime.timeZone);
|
|
947
|
+
return $6de69c682dff3674$export$b4a036af3fc0b032(res, dateTime.calendar);
|
|
948
948
|
}
|
|
949
|
-
function $
|
|
950
|
-
return $
|
|
949
|
+
function $b795f1a945a78ee3$export$6814caac34ca03c7(dateTime, duration) {
|
|
950
|
+
return $b795f1a945a78ee3$export$96b1d28349274637(dateTime, $b795f1a945a78ee3$export$3e2544e88a25bff8(duration));
|
|
951
951
|
}
|
|
952
|
-
function $
|
|
952
|
+
function $b795f1a945a78ee3$export$9a297d111fc86b79(dateTime, field, amount, options) {
|
|
953
953
|
// For date fields, we want the time to remain consistent and the UTC offset to potentially change to account for DST changes.
|
|
954
954
|
// For time fields, we want the time to change by the amount given. This may result in the hour field staying the same, but the UTC
|
|
955
955
|
// offset changing in the case of a backward DST transition, or skipping an hour in the case of a forward DST transition.
|
|
@@ -958,7 +958,7 @@ function $2ae8fe19e7cd4af8$export$9a297d111fc86b79(dateTime, field, amount, opti
|
|
|
958
958
|
{
|
|
959
959
|
let min = 0;
|
|
960
960
|
let max = 23;
|
|
961
|
-
if (options
|
|
961
|
+
if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
|
|
962
962
|
let isPM = dateTime.hour >= 12;
|
|
963
963
|
min = isPM ? 12 : 0;
|
|
964
964
|
max = isPM ? 23 : 11;
|
|
@@ -968,165 +968,167 @@ function $2ae8fe19e7cd4af8$export$9a297d111fc86b79(dateTime, field, amount, opti
|
|
|
968
968
|
// Or it might end at midnight and repeat the 11pm hour. To handle this, we get
|
|
969
969
|
// the possible absolute times for the min and max, and find the maximum range
|
|
970
970
|
// that is within the current day.
|
|
971
|
-
let plainDateTime = $
|
|
972
|
-
let minDate = $
|
|
971
|
+
let plainDateTime = $6de69c682dff3674$export$b21e0b124e224484(dateTime);
|
|
972
|
+
let minDate = $6de69c682dff3674$export$b4a036af3fc0b032($b795f1a945a78ee3$export$e5d5e1c1822b6e56(plainDateTime, {
|
|
973
973
|
hour: min
|
|
974
|
-
}), new $
|
|
974
|
+
}), new $680b26d521b88d00$export$80ee6245ec4f29ec());
|
|
975
975
|
let minAbsolute = [
|
|
976
|
-
$
|
|
977
|
-
$
|
|
978
|
-
].filter((ms)=>$
|
|
976
|
+
$6de69c682dff3674$export$5107c82f94518f5c(minDate, dateTime.timeZone, 'earlier'),
|
|
977
|
+
$6de69c682dff3674$export$5107c82f94518f5c(minDate, dateTime.timeZone, 'later')
|
|
978
|
+
].filter((ms)=>$6de69c682dff3674$export$1b96692a1ba042ac(ms, dateTime.timeZone).day === minDate.day
|
|
979
979
|
)[0];
|
|
980
|
-
let maxDate = $
|
|
980
|
+
let maxDate = $6de69c682dff3674$export$b4a036af3fc0b032($b795f1a945a78ee3$export$e5d5e1c1822b6e56(plainDateTime, {
|
|
981
981
|
hour: max
|
|
982
|
-
}), new $
|
|
982
|
+
}), new $680b26d521b88d00$export$80ee6245ec4f29ec());
|
|
983
983
|
let maxAbsolute = [
|
|
984
|
-
$
|
|
985
|
-
$
|
|
986
|
-
].filter((ms)=>$
|
|
984
|
+
$6de69c682dff3674$export$5107c82f94518f5c(maxDate, dateTime.timeZone, 'earlier'),
|
|
985
|
+
$6de69c682dff3674$export$5107c82f94518f5c(maxDate, dateTime.timeZone, 'later')
|
|
986
|
+
].filter((ms)=>$6de69c682dff3674$export$1b96692a1ba042ac(ms, dateTime.timeZone).day === maxDate.day
|
|
987
987
|
).pop();
|
|
988
988
|
// Since hours may repeat, we need to operate on the absolute time in milliseconds.
|
|
989
989
|
// This is done in hours from the Unix epoch so that cycleValue works correctly,
|
|
990
990
|
// and then converted back to milliseconds.
|
|
991
|
-
let ms1 = $
|
|
992
|
-
let hours = Math.floor(ms1 / $
|
|
993
|
-
let remainder = ms1 % $
|
|
994
|
-
ms1 = $
|
|
991
|
+
let ms1 = $6de69c682dff3674$export$bd4fb2bc8bb06fb(dateTime) - dateTime.offset;
|
|
992
|
+
let hours = Math.floor(ms1 / $b795f1a945a78ee3$var$ONE_HOUR);
|
|
993
|
+
let remainder = ms1 % $b795f1a945a78ee3$var$ONE_HOUR;
|
|
994
|
+
ms1 = $b795f1a945a78ee3$var$cycleValue(hours, amount, Math.floor(minAbsolute / $b795f1a945a78ee3$var$ONE_HOUR), Math.floor(maxAbsolute / $b795f1a945a78ee3$var$ONE_HOUR), options === null || options === void 0 ? void 0 : options.round) * $b795f1a945a78ee3$var$ONE_HOUR + remainder;
|
|
995
995
|
// Now compute the new timezone offset, and convert the absolute time back to local time.
|
|
996
|
-
return $
|
|
996
|
+
return $6de69c682dff3674$export$b4a036af3fc0b032($6de69c682dff3674$export$1b96692a1ba042ac(ms1, dateTime.timeZone), dateTime.calendar);
|
|
997
997
|
}
|
|
998
998
|
case 'minute':
|
|
999
999
|
case 'second':
|
|
1000
1000
|
case 'millisecond':
|
|
1001
1001
|
// @ts-ignore
|
|
1002
|
-
return $
|
|
1002
|
+
return $b795f1a945a78ee3$export$dd02b3e0007dfe28(dateTime, field, amount, options);
|
|
1003
1003
|
case 'era':
|
|
1004
1004
|
case 'year':
|
|
1005
1005
|
case 'month':
|
|
1006
1006
|
case 'day':
|
|
1007
1007
|
{
|
|
1008
|
-
let res = $
|
|
1009
|
-
let ms = $
|
|
1010
|
-
return $
|
|
1008
|
+
let res = $b795f1a945a78ee3$export$d52ced6badfb9a4c($6de69c682dff3674$export$b21e0b124e224484(dateTime), field, amount, options);
|
|
1009
|
+
let ms = $6de69c682dff3674$export$5107c82f94518f5c(res, dateTime.timeZone);
|
|
1010
|
+
return $6de69c682dff3674$export$b4a036af3fc0b032($6de69c682dff3674$export$1b96692a1ba042ac(ms, dateTime.timeZone), dateTime.calendar);
|
|
1011
1011
|
}
|
|
1012
1012
|
default:
|
|
1013
1013
|
throw new Error('Unsupported field ' + field);
|
|
1014
1014
|
}
|
|
1015
1015
|
}
|
|
1016
|
-
function $
|
|
1016
|
+
function $b795f1a945a78ee3$export$31b5430eb18be4f8(dateTime, fields, disambiguation) {
|
|
1017
1017
|
// Set the date/time fields, and recompute the UTC offset to account for DST changes.
|
|
1018
1018
|
// We also need to validate by converting back to a local time in case hours are skipped during forward DST transitions.
|
|
1019
|
-
let plainDateTime = $
|
|
1020
|
-
let res = $
|
|
1019
|
+
let plainDateTime = $6de69c682dff3674$export$b21e0b124e224484(dateTime);
|
|
1020
|
+
let res = $b795f1a945a78ee3$export$e5d5e1c1822b6e56($b795f1a945a78ee3$export$adaa4cf7ef1b65be(plainDateTime, fields), fields);
|
|
1021
1021
|
// If the resulting plain date time values are equal, return the original time.
|
|
1022
1022
|
// We don't want to change the offset when setting the time to the same value.
|
|
1023
1023
|
if (res.compare(plainDateTime) === 0) return dateTime;
|
|
1024
|
-
let ms = $
|
|
1025
|
-
return $
|
|
1024
|
+
let ms = $6de69c682dff3674$export$5107c82f94518f5c(res, dateTime.timeZone, disambiguation);
|
|
1025
|
+
return $6de69c682dff3674$export$b4a036af3fc0b032($6de69c682dff3674$export$1b96692a1ba042ac(ms, dateTime.timeZone), dateTime.calendar);
|
|
1026
1026
|
}
|
|
1027
1027
|
|
|
1028
1028
|
|
|
1029
1029
|
|
|
1030
|
-
var $
|
|
1030
|
+
var $6f8483c3b5544266$exports = {};
|
|
1031
1031
|
|
|
1032
|
-
$parcel$export($
|
|
1033
|
-
$parcel$export($
|
|
1034
|
-
$parcel$export($
|
|
1035
|
-
$parcel$export($
|
|
1036
|
-
$parcel$export($
|
|
1037
|
-
$parcel$export($
|
|
1038
|
-
$parcel$export($
|
|
1039
|
-
$parcel$export($
|
|
1040
|
-
$parcel$export($
|
|
1041
|
-
$parcel$export($
|
|
1032
|
+
$parcel$export($6f8483c3b5544266$exports, "parseTime", () => $6f8483c3b5544266$export$c9698ec7f05a07e1);
|
|
1033
|
+
$parcel$export($6f8483c3b5544266$exports, "parseDate", () => $6f8483c3b5544266$export$6b862160d295c8e);
|
|
1034
|
+
$parcel$export($6f8483c3b5544266$exports, "parseDateTime", () => $6f8483c3b5544266$export$588937bcd60ade55);
|
|
1035
|
+
$parcel$export($6f8483c3b5544266$exports, "parseZonedDateTime", () => $6f8483c3b5544266$export$fd7893f06e92a6a4);
|
|
1036
|
+
$parcel$export($6f8483c3b5544266$exports, "dateTimeToString", () => $6f8483c3b5544266$export$4223de14708adc63);
|
|
1037
|
+
$parcel$export($6f8483c3b5544266$exports, "parseAbsolute", () => $6f8483c3b5544266$export$5adfdab05168c219);
|
|
1038
|
+
$parcel$export($6f8483c3b5544266$exports, "parseAbsoluteToLocal", () => $6f8483c3b5544266$export$8e384432362ed0f0);
|
|
1039
|
+
$parcel$export($6f8483c3b5544266$exports, "timeToString", () => $6f8483c3b5544266$export$f59dee82248f5ad4);
|
|
1040
|
+
$parcel$export($6f8483c3b5544266$exports, "dateToString", () => $6f8483c3b5544266$export$60dfd74aa96791bd);
|
|
1041
|
+
$parcel$export($6f8483c3b5544266$exports, "zonedDateTimeToString", () => $6f8483c3b5544266$export$bf79f1ebf4b18792);
|
|
1042
1042
|
|
|
1043
1043
|
|
|
1044
1044
|
|
|
1045
1045
|
|
|
1046
|
-
const $
|
|
1047
|
-
const $
|
|
1048
|
-
const $
|
|
1049
|
-
const $
|
|
1050
|
-
const $
|
|
1051
|
-
function $
|
|
1052
|
-
let m = value.match($
|
|
1046
|
+
const $6f8483c3b5544266$var$TIME_RE = /^(\d{2})(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/;
|
|
1047
|
+
const $6f8483c3b5544266$var$DATE_RE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
1048
|
+
const $6f8483c3b5544266$var$DATE_TIME_RE = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/;
|
|
1049
|
+
const $6f8483c3b5544266$var$ZONED_DATE_TIME_RE = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:([+-]\d{2})(?::(\d{2}))?)?\[(.*?)\]$/;
|
|
1050
|
+
const $6f8483c3b5544266$var$ABSOLUTE_RE = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::(\d{2}))?)|Z)$/;
|
|
1051
|
+
function $6f8483c3b5544266$export$c9698ec7f05a07e1(value) {
|
|
1052
|
+
let m = value.match($6f8483c3b5544266$var$TIME_RE);
|
|
1053
1053
|
if (!m) throw new Error('Invalid ISO 8601 time string: ' + value);
|
|
1054
|
-
return new $
|
|
1054
|
+
return new $e2d97aa3b7775168$export$680ea196effce5f($6f8483c3b5544266$var$parseNumber(m[1], 0, 23), m[2] ? $6f8483c3b5544266$var$parseNumber(m[2], 0, 59) : 0, m[3] ? $6f8483c3b5544266$var$parseNumber(m[3], 0, 59) : 0, m[4] ? $6f8483c3b5544266$var$parseNumber(m[4], 0, Infinity) * 1000 : 0);
|
|
1055
1055
|
}
|
|
1056
|
-
function $
|
|
1057
|
-
let m = value.match($
|
|
1056
|
+
function $6f8483c3b5544266$export$6b862160d295c8e(value) {
|
|
1057
|
+
let m = value.match($6f8483c3b5544266$var$DATE_RE);
|
|
1058
1058
|
if (!m) throw new Error('Invalid ISO 8601 date string: ' + value);
|
|
1059
|
-
let date = new $
|
|
1060
|
-
date.day = $
|
|
1059
|
+
let date = new $e2d97aa3b7775168$export$99faa760c7908e4f($6f8483c3b5544266$var$parseNumber(m[1], 0, 9999), $6f8483c3b5544266$var$parseNumber(m[2], 1, 12), 1);
|
|
1060
|
+
date.day = $6f8483c3b5544266$var$parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));
|
|
1061
1061
|
return date;
|
|
1062
1062
|
}
|
|
1063
|
-
function $
|
|
1064
|
-
let m = value.match($
|
|
1063
|
+
function $6f8483c3b5544266$export$588937bcd60ade55(value) {
|
|
1064
|
+
let m = value.match($6f8483c3b5544266$var$DATE_TIME_RE);
|
|
1065
1065
|
if (!m) throw new Error('Invalid ISO 8601 date time string: ' + value);
|
|
1066
|
-
let date = new $
|
|
1067
|
-
date.day = $
|
|
1066
|
+
let date = new $e2d97aa3b7775168$export$ca871e8dbb80966f($6f8483c3b5544266$var$parseNumber(m[1], 1, 9999), $6f8483c3b5544266$var$parseNumber(m[2], 1, 12), 1, m[4] ? $6f8483c3b5544266$var$parseNumber(m[4], 0, 23) : 0, m[5] ? $6f8483c3b5544266$var$parseNumber(m[5], 0, 59) : 0, m[6] ? $6f8483c3b5544266$var$parseNumber(m[6], 0, 59) : 0, m[7] ? $6f8483c3b5544266$var$parseNumber(m[7], 0, Infinity) * 1000 : 0);
|
|
1067
|
+
date.day = $6f8483c3b5544266$var$parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));
|
|
1068
1068
|
return date;
|
|
1069
1069
|
}
|
|
1070
|
-
function $
|
|
1071
|
-
let m = value.match($
|
|
1070
|
+
function $6f8483c3b5544266$export$fd7893f06e92a6a4(value, disambiguation) {
|
|
1071
|
+
let m = value.match($6f8483c3b5544266$var$ZONED_DATE_TIME_RE);
|
|
1072
1072
|
if (!m) throw new Error('Invalid ISO 8601 date time string: ' + value);
|
|
1073
|
-
let date = new $
|
|
1074
|
-
date.day = $
|
|
1075
|
-
let plainDateTime = $
|
|
1073
|
+
let date = new $e2d97aa3b7775168$export$d3b7288e7994edea($6f8483c3b5544266$var$parseNumber(m[1], 1, 9999), $6f8483c3b5544266$var$parseNumber(m[2], 1, 12), 1, m[10], 0, m[4] ? $6f8483c3b5544266$var$parseNumber(m[4], 0, 23) : 0, m[5] ? $6f8483c3b5544266$var$parseNumber(m[5], 0, 59) : 0, m[6] ? $6f8483c3b5544266$var$parseNumber(m[6], 0, 59) : 0, m[7] ? $6f8483c3b5544266$var$parseNumber(m[7], 0, Infinity) * 1000 : 0);
|
|
1074
|
+
date.day = $6f8483c3b5544266$var$parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));
|
|
1075
|
+
let plainDateTime = $6de69c682dff3674$export$b21e0b124e224484(date);
|
|
1076
1076
|
let ms;
|
|
1077
1077
|
if (m[8]) {
|
|
1078
|
-
|
|
1079
|
-
|
|
1078
|
+
var ref;
|
|
1079
|
+
date.offset = $6f8483c3b5544266$var$parseNumber(m[8], -23, 23) * 3600000 + $6f8483c3b5544266$var$parseNumber((ref = m[9]) !== null && ref !== void 0 ? ref : '0', 0, 59) * 60000;
|
|
1080
|
+
ms = $6de69c682dff3674$export$bd4fb2bc8bb06fb(date) - date.offset;
|
|
1080
1081
|
// Validate offset against parsed date.
|
|
1081
|
-
let absolutes = $
|
|
1082
|
-
if (!absolutes.includes(ms)) throw new Error(`Offset ${$
|
|
1082
|
+
let absolutes = $6de69c682dff3674$export$136f38efe7caf549(plainDateTime, date.timeZone);
|
|
1083
|
+
if (!absolutes.includes(ms)) throw new Error(`Offset ${$6f8483c3b5544266$var$offsetToString(date.offset)} is invalid for ${$6f8483c3b5544266$export$4223de14708adc63(date)} in ${date.timeZone}`);
|
|
1083
1084
|
} else // Convert to absolute and back to fix invalid times due to DST.
|
|
1084
|
-
ms = $
|
|
1085
|
-
return $
|
|
1085
|
+
ms = $6de69c682dff3674$export$5107c82f94518f5c($6de69c682dff3674$export$b21e0b124e224484(plainDateTime), date.timeZone, disambiguation);
|
|
1086
|
+
return $6de69c682dff3674$export$1b96692a1ba042ac(ms, date.timeZone);
|
|
1086
1087
|
}
|
|
1087
|
-
function $
|
|
1088
|
-
let m = value.match($
|
|
1088
|
+
function $6f8483c3b5544266$export$5adfdab05168c219(value, timeZone) {
|
|
1089
|
+
let m = value.match($6f8483c3b5544266$var$ABSOLUTE_RE);
|
|
1089
1090
|
if (!m) throw new Error('Invalid ISO 8601 date time string: ' + value);
|
|
1090
|
-
let date = new $
|
|
1091
|
-
date.day = $
|
|
1092
|
-
|
|
1093
|
-
|
|
1091
|
+
let date = new $e2d97aa3b7775168$export$d3b7288e7994edea($6f8483c3b5544266$var$parseNumber(m[1], 1, 9999), $6f8483c3b5544266$var$parseNumber(m[2], 1, 12), 1, timeZone, 0, m[4] ? $6f8483c3b5544266$var$parseNumber(m[4], 0, 23) : 0, m[5] ? $6f8483c3b5544266$var$parseNumber(m[5], 0, 59) : 0, m[6] ? $6f8483c3b5544266$var$parseNumber(m[6], 0, 59) : 0, m[7] ? $6f8483c3b5544266$var$parseNumber(m[7], 0, Infinity) * 1000 : 0);
|
|
1092
|
+
date.day = $6f8483c3b5544266$var$parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));
|
|
1093
|
+
var ref;
|
|
1094
|
+
if (m[8]) date.offset = $6f8483c3b5544266$var$parseNumber(m[8], -23, 23) * 3600000 + $6f8483c3b5544266$var$parseNumber((ref = m[9]) !== null && ref !== void 0 ? ref : '0', 0, 59) * 60000;
|
|
1095
|
+
return $6de69c682dff3674$export$538b00033cc11c75(date, timeZone);
|
|
1094
1096
|
}
|
|
1095
|
-
function $
|
|
1096
|
-
return $
|
|
1097
|
+
function $6f8483c3b5544266$export$8e384432362ed0f0(value) {
|
|
1098
|
+
return $6f8483c3b5544266$export$5adfdab05168c219(value, $8180638d62fba910$export$aa8b41735afcabd2());
|
|
1097
1099
|
}
|
|
1098
|
-
function $
|
|
1100
|
+
function $6f8483c3b5544266$var$parseNumber(value, min, max) {
|
|
1099
1101
|
let val = Number(value);
|
|
1100
1102
|
if (val < min || val > max) throw new RangeError(`Value out of range: ${min} <= ${val} <= ${max}`);
|
|
1101
1103
|
return val;
|
|
1102
1104
|
}
|
|
1103
|
-
function $
|
|
1105
|
+
function $6f8483c3b5544266$export$f59dee82248f5ad4(time) {
|
|
1104
1106
|
return `${String(time.hour).padStart(2, '0')}:${String(time.minute).padStart(2, '0')}:${String(time.second).padStart(2, '0')}${time.millisecond ? String(time.millisecond / 1000).slice(1) : ''}`;
|
|
1105
1107
|
}
|
|
1106
|
-
function $
|
|
1107
|
-
let gregorianDate = $
|
|
1108
|
+
function $6f8483c3b5544266$export$60dfd74aa96791bd(date) {
|
|
1109
|
+
let gregorianDate = $6de69c682dff3674$export$b4a036af3fc0b032(date, new $680b26d521b88d00$export$80ee6245ec4f29ec());
|
|
1108
1110
|
return `${String(gregorianDate.year).padStart(4, '0')}-${String(gregorianDate.month).padStart(2, '0')}-${String(gregorianDate.day).padStart(2, '0')}`;
|
|
1109
1111
|
}
|
|
1110
|
-
function $
|
|
1112
|
+
function $6f8483c3b5544266$export$4223de14708adc63(date) {
|
|
1111
1113
|
// @ts-ignore
|
|
1112
|
-
return `${$
|
|
1114
|
+
return `${$6f8483c3b5544266$export$60dfd74aa96791bd(date)}T${$6f8483c3b5544266$export$f59dee82248f5ad4(date)}`;
|
|
1113
1115
|
}
|
|
1114
|
-
function $
|
|
1116
|
+
function $6f8483c3b5544266$var$offsetToString(offset) {
|
|
1115
1117
|
let sign = Math.sign(offset) < 0 ? '-' : '+';
|
|
1116
1118
|
offset = Math.abs(offset);
|
|
1117
1119
|
let offsetHours = Math.floor(offset / 3600000);
|
|
1118
1120
|
let offsetMinutes = offset % 3600000 / 60000;
|
|
1119
1121
|
return `${sign}${String(offsetHours).padStart(2, '0')}:${String(offsetMinutes).padStart(2, '0')}`;
|
|
1120
1122
|
}
|
|
1121
|
-
function $
|
|
1122
|
-
return `${$
|
|
1123
|
+
function $6f8483c3b5544266$export$bf79f1ebf4b18792(date) {
|
|
1124
|
+
return `${$6f8483c3b5544266$export$4223de14708adc63(date)}${$6f8483c3b5544266$var$offsetToString(date.offset)}[${date.timeZone}]`;
|
|
1123
1125
|
}
|
|
1124
1126
|
|
|
1125
1127
|
|
|
1126
1128
|
|
|
1127
1129
|
|
|
1128
|
-
function $
|
|
1129
|
-
let calendar = typeof args[0] === 'object' ? args.shift() : new $
|
|
1130
|
+
function $e2d97aa3b7775168$var$shiftArgs(args) {
|
|
1131
|
+
let calendar = typeof args[0] === 'object' ? args.shift() : new $680b26d521b88d00$export$80ee6245ec4f29ec();
|
|
1130
1132
|
let era;
|
|
1131
1133
|
if (typeof args[0] === 'string') era = args.shift();
|
|
1132
1134
|
else {
|
|
@@ -1144,106 +1146,99 @@ function $9bb5411e4ba634f9$var$shiftArgs(args) {
|
|
|
1144
1146
|
day
|
|
1145
1147
|
];
|
|
1146
1148
|
}
|
|
1147
|
-
class $
|
|
1148
|
-
// This prevents TypeScript from allowing other types with the same fields to match.
|
|
1149
|
-
// i.e. a ZonedDateTime should not be be passable to a parameter that expects CalendarDate.
|
|
1150
|
-
// If that behavior is desired, use the AnyCalendarDate interface instead.
|
|
1151
|
-
#type;
|
|
1152
|
-
constructor(...args){
|
|
1153
|
-
let [calendar, era, year, month, day] = $9bb5411e4ba634f9$var$shiftArgs(args);
|
|
1154
|
-
this.calendar = calendar;
|
|
1155
|
-
this.era = era;
|
|
1156
|
-
this.year = year;
|
|
1157
|
-
this.month = month;
|
|
1158
|
-
this.day = day;
|
|
1159
|
-
$2ae8fe19e7cd4af8$export$c4e2ecac49351ef2(this);
|
|
1160
|
-
}
|
|
1149
|
+
class $e2d97aa3b7775168$export$99faa760c7908e4f {
|
|
1161
1150
|
copy() {
|
|
1162
|
-
if (this.era) return new $
|
|
1163
|
-
else return new $
|
|
1151
|
+
if (this.era) return new $e2d97aa3b7775168$export$99faa760c7908e4f(this.calendar, this.era, this.year, this.month, this.day);
|
|
1152
|
+
else return new $e2d97aa3b7775168$export$99faa760c7908e4f(this.calendar, this.year, this.month, this.day);
|
|
1164
1153
|
}
|
|
1165
1154
|
add(duration) {
|
|
1166
|
-
return $
|
|
1155
|
+
return $b795f1a945a78ee3$export$e16d8520af44a096(this, duration);
|
|
1167
1156
|
}
|
|
1168
1157
|
subtract(duration) {
|
|
1169
|
-
return $
|
|
1158
|
+
return $b795f1a945a78ee3$export$4e2d2ead65e5f7e3(this, duration);
|
|
1170
1159
|
}
|
|
1171
1160
|
set(fields) {
|
|
1172
|
-
return $
|
|
1161
|
+
return $b795f1a945a78ee3$export$adaa4cf7ef1b65be(this, fields);
|
|
1173
1162
|
}
|
|
1174
1163
|
cycle(field, amount, options) {
|
|
1175
|
-
return $
|
|
1164
|
+
return $b795f1a945a78ee3$export$d52ced6badfb9a4c(this, field, amount, options);
|
|
1176
1165
|
}
|
|
1177
1166
|
toDate(timeZone) {
|
|
1178
|
-
return $
|
|
1167
|
+
return $6de69c682dff3674$export$e67a095c620b86fe(this, timeZone);
|
|
1179
1168
|
}
|
|
1180
1169
|
toString() {
|
|
1181
|
-
return $
|
|
1170
|
+
return $6f8483c3b5544266$export$60dfd74aa96791bd(this);
|
|
1182
1171
|
}
|
|
1183
1172
|
compare(b) {
|
|
1184
|
-
return $
|
|
1173
|
+
return $8180638d62fba910$export$68781ddf31c0090f(this, b);
|
|
1185
1174
|
}
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1175
|
+
constructor(...args){
|
|
1176
|
+
// This prevents TypeScript from allowing other types with the same fields to match.
|
|
1177
|
+
// i.e. a ZonedDateTime should not be be passable to a parameter that expects CalendarDate.
|
|
1178
|
+
// If that behavior is desired, use the AnyCalendarDate interface instead.
|
|
1179
|
+
_type.set(this, {
|
|
1180
|
+
writable: true,
|
|
1181
|
+
value: void 0
|
|
1182
|
+
});
|
|
1183
|
+
let [calendar, era, year, month, day] = $e2d97aa3b7775168$var$shiftArgs(args);
|
|
1184
|
+
this.calendar = calendar;
|
|
1185
|
+
this.era = era;
|
|
1186
|
+
this.year = year;
|
|
1187
|
+
this.month = month;
|
|
1188
|
+
this.day = day;
|
|
1189
|
+
$b795f1a945a78ee3$export$c4e2ecac49351ef2(this);
|
|
1196
1190
|
}
|
|
1191
|
+
}
|
|
1192
|
+
var _type = new WeakMap();
|
|
1193
|
+
class $e2d97aa3b7775168$export$680ea196effce5f {
|
|
1197
1194
|
copy() {
|
|
1198
|
-
return new $
|
|
1195
|
+
return new $e2d97aa3b7775168$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond);
|
|
1199
1196
|
}
|
|
1200
1197
|
add(duration) {
|
|
1201
|
-
return $
|
|
1198
|
+
return $b795f1a945a78ee3$export$7ed87b6bc2506470(this, duration);
|
|
1202
1199
|
}
|
|
1203
1200
|
subtract(duration) {
|
|
1204
|
-
return $
|
|
1201
|
+
return $b795f1a945a78ee3$export$fe34d3a381cd7501(this, duration);
|
|
1205
1202
|
}
|
|
1206
1203
|
set(fields) {
|
|
1207
|
-
return $
|
|
1204
|
+
return $b795f1a945a78ee3$export$e5d5e1c1822b6e56(this, fields);
|
|
1208
1205
|
}
|
|
1209
1206
|
cycle(field, amount, options) {
|
|
1210
|
-
return $
|
|
1207
|
+
return $b795f1a945a78ee3$export$dd02b3e0007dfe28(this, field, amount, options);
|
|
1211
1208
|
}
|
|
1212
1209
|
toString() {
|
|
1213
|
-
return $
|
|
1210
|
+
return $6f8483c3b5544266$export$f59dee82248f5ad4(this);
|
|
1214
1211
|
}
|
|
1215
1212
|
compare(b) {
|
|
1216
|
-
return $
|
|
1213
|
+
return $8180638d62fba910$export$c19a80a9721b80f6(this, b);
|
|
1217
1214
|
}
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
this.
|
|
1225
|
-
this.
|
|
1226
|
-
this.
|
|
1227
|
-
this.
|
|
1228
|
-
this
|
|
1229
|
-
this.hour = args.shift() || 0;
|
|
1230
|
-
this.minute = args.shift() || 0;
|
|
1231
|
-
this.second = args.shift() || 0;
|
|
1232
|
-
this.millisecond = args.shift() || 0;
|
|
1233
|
-
$2ae8fe19e7cd4af8$export$c4e2ecac49351ef2(this);
|
|
1215
|
+
constructor(hour = 0, minute = 0, second = 0, millisecond = 0){
|
|
1216
|
+
// This prevents TypeScript from allowing other types with the same fields to match.
|
|
1217
|
+
_type1.set(this, {
|
|
1218
|
+
writable: true,
|
|
1219
|
+
value: void 0
|
|
1220
|
+
});
|
|
1221
|
+
this.hour = hour;
|
|
1222
|
+
this.minute = minute;
|
|
1223
|
+
this.second = second;
|
|
1224
|
+
this.millisecond = millisecond;
|
|
1225
|
+
$b795f1a945a78ee3$export$7555de1e070510cb(this);
|
|
1234
1226
|
}
|
|
1227
|
+
}
|
|
1228
|
+
var _type1 = new WeakMap();
|
|
1229
|
+
class $e2d97aa3b7775168$export$ca871e8dbb80966f {
|
|
1235
1230
|
copy() {
|
|
1236
|
-
if (this.era) return new $
|
|
1237
|
-
else return new $
|
|
1231
|
+
if (this.era) return new $e2d97aa3b7775168$export$ca871e8dbb80966f(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
|
|
1232
|
+
else return new $e2d97aa3b7775168$export$ca871e8dbb80966f(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
|
|
1238
1233
|
}
|
|
1239
1234
|
add(duration) {
|
|
1240
|
-
return $
|
|
1235
|
+
return $b795f1a945a78ee3$export$e16d8520af44a096(this, duration);
|
|
1241
1236
|
}
|
|
1242
1237
|
subtract(duration) {
|
|
1243
|
-
return $
|
|
1238
|
+
return $b795f1a945a78ee3$export$4e2d2ead65e5f7e3(this, duration);
|
|
1244
1239
|
}
|
|
1245
1240
|
set(fields) {
|
|
1246
|
-
return $
|
|
1241
|
+
return $b795f1a945a78ee3$export$adaa4cf7ef1b65be($b795f1a945a78ee3$export$e5d5e1c1822b6e56(this, fields), fields);
|
|
1247
1242
|
}
|
|
1248
1243
|
cycle(field, amount, options) {
|
|
1249
1244
|
switch(field){
|
|
@@ -1251,79 +1246,102 @@ class $9bb5411e4ba634f9$export$ca871e8dbb80966f {
|
|
|
1251
1246
|
case 'year':
|
|
1252
1247
|
case 'month':
|
|
1253
1248
|
case 'day':
|
|
1254
|
-
return $
|
|
1249
|
+
return $b795f1a945a78ee3$export$d52ced6badfb9a4c(this, field, amount, options);
|
|
1255
1250
|
default:
|
|
1256
|
-
return $
|
|
1251
|
+
return $b795f1a945a78ee3$export$dd02b3e0007dfe28(this, field, amount, options);
|
|
1257
1252
|
}
|
|
1258
1253
|
}
|
|
1259
1254
|
toDate(timeZone) {
|
|
1260
|
-
return $
|
|
1255
|
+
return $6de69c682dff3674$export$e67a095c620b86fe(this, timeZone);
|
|
1261
1256
|
}
|
|
1262
1257
|
toString() {
|
|
1263
|
-
return $
|
|
1258
|
+
return $6f8483c3b5544266$export$4223de14708adc63(this);
|
|
1264
1259
|
}
|
|
1265
1260
|
compare(b) {
|
|
1266
|
-
let res = $
|
|
1267
|
-
if (res === 0) return $
|
|
1261
|
+
let res = $8180638d62fba910$export$68781ddf31c0090f(this, b);
|
|
1262
|
+
if (res === 0) return $8180638d62fba910$export$c19a80a9721b80f6(this, $6de69c682dff3674$export$b21e0b124e224484(b));
|
|
1268
1263
|
return res;
|
|
1269
1264
|
}
|
|
1270
|
-
}
|
|
1271
|
-
class $9bb5411e4ba634f9$export$d3b7288e7994edea {
|
|
1272
|
-
// This prevents TypeScript from allowing other types with the same fields to match.
|
|
1273
|
-
#type;
|
|
1274
1265
|
constructor(...args){
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1266
|
+
// This prevents TypeScript from allowing other types with the same fields to match.
|
|
1267
|
+
_type2.set(this, {
|
|
1268
|
+
writable: true,
|
|
1269
|
+
value: void 0
|
|
1270
|
+
});
|
|
1271
|
+
let [calendar, era, year, month, day] = $e2d97aa3b7775168$var$shiftArgs(args);
|
|
1278
1272
|
this.calendar = calendar;
|
|
1279
1273
|
this.era = era;
|
|
1280
1274
|
this.year = year;
|
|
1281
1275
|
this.month = month;
|
|
1282
1276
|
this.day = day;
|
|
1283
|
-
this.timeZone = timeZone;
|
|
1284
|
-
this.offset = offset;
|
|
1285
1277
|
this.hour = args.shift() || 0;
|
|
1286
1278
|
this.minute = args.shift() || 0;
|
|
1287
1279
|
this.second = args.shift() || 0;
|
|
1288
1280
|
this.millisecond = args.shift() || 0;
|
|
1289
|
-
$
|
|
1281
|
+
$b795f1a945a78ee3$export$c4e2ecac49351ef2(this);
|
|
1290
1282
|
}
|
|
1283
|
+
}
|
|
1284
|
+
var _type2 = new WeakMap();
|
|
1285
|
+
class $e2d97aa3b7775168$export$d3b7288e7994edea {
|
|
1291
1286
|
copy() {
|
|
1292
|
-
if (this.era) return new $
|
|
1293
|
-
else return new $
|
|
1287
|
+
if (this.era) return new $e2d97aa3b7775168$export$d3b7288e7994edea(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
|
|
1288
|
+
else return new $e2d97aa3b7775168$export$d3b7288e7994edea(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
|
|
1294
1289
|
}
|
|
1295
1290
|
add(duration) {
|
|
1296
|
-
return $
|
|
1291
|
+
return $b795f1a945a78ee3$export$96b1d28349274637(this, duration);
|
|
1297
1292
|
}
|
|
1298
1293
|
subtract(duration) {
|
|
1299
|
-
return $
|
|
1294
|
+
return $b795f1a945a78ee3$export$6814caac34ca03c7(this, duration);
|
|
1300
1295
|
}
|
|
1301
1296
|
set(fields, disambiguation) {
|
|
1302
|
-
return $
|
|
1297
|
+
return $b795f1a945a78ee3$export$31b5430eb18be4f8(this, fields, disambiguation);
|
|
1303
1298
|
}
|
|
1304
1299
|
cycle(field, amount, options) {
|
|
1305
|
-
return $
|
|
1300
|
+
return $b795f1a945a78ee3$export$9a297d111fc86b79(this, field, amount, options);
|
|
1306
1301
|
}
|
|
1307
1302
|
toDate() {
|
|
1308
|
-
return $
|
|
1303
|
+
return $6de69c682dff3674$export$83aac07b4c37b25(this);
|
|
1309
1304
|
}
|
|
1310
1305
|
toString() {
|
|
1311
|
-
return $
|
|
1306
|
+
return $6f8483c3b5544266$export$bf79f1ebf4b18792(this);
|
|
1312
1307
|
}
|
|
1313
1308
|
toAbsoluteString() {
|
|
1314
1309
|
return this.toDate().toISOString();
|
|
1315
1310
|
}
|
|
1316
1311
|
compare(b) {
|
|
1317
1312
|
// TODO: Is this a bad idea??
|
|
1318
|
-
return this.toDate().getTime() - $
|
|
1313
|
+
return this.toDate().getTime() - $6de69c682dff3674$export$84c95a83c799e074(b, this.timeZone).toDate().getTime();
|
|
1314
|
+
}
|
|
1315
|
+
constructor(...args){
|
|
1316
|
+
// This prevents TypeScript from allowing other types with the same fields to match.
|
|
1317
|
+
_type3.set(this, {
|
|
1318
|
+
writable: true,
|
|
1319
|
+
value: void 0
|
|
1320
|
+
});
|
|
1321
|
+
let [calendar, era, year, month, day] = $e2d97aa3b7775168$var$shiftArgs(args);
|
|
1322
|
+
let timeZone = args.shift();
|
|
1323
|
+
let offset = args.shift();
|
|
1324
|
+
this.calendar = calendar;
|
|
1325
|
+
this.era = era;
|
|
1326
|
+
this.year = year;
|
|
1327
|
+
this.month = month;
|
|
1328
|
+
this.day = day;
|
|
1329
|
+
this.timeZone = timeZone;
|
|
1330
|
+
this.offset = offset;
|
|
1331
|
+
this.hour = args.shift() || 0;
|
|
1332
|
+
this.minute = args.shift() || 0;
|
|
1333
|
+
this.second = args.shift() || 0;
|
|
1334
|
+
this.millisecond = args.shift() || 0;
|
|
1335
|
+
$b795f1a945a78ee3$export$c4e2ecac49351ef2(this);
|
|
1319
1336
|
}
|
|
1320
1337
|
}
|
|
1338
|
+
var _type3 = new WeakMap();
|
|
1321
1339
|
|
|
1322
1340
|
|
|
1323
1341
|
|
|
1324
1342
|
|
|
1325
1343
|
|
|
1326
|
-
const $
|
|
1344
|
+
const $a829bc7a11c5e72b$var$ERA_START_DATES = [
|
|
1327
1345
|
[
|
|
1328
1346
|
1868,
|
|
1329
1347
|
9,
|
|
@@ -1350,7 +1368,7 @@ const $4c8188d4ddf4ec96$var$ERA_START_DATES = [
|
|
|
1350
1368
|
1
|
|
1351
1369
|
]
|
|
1352
1370
|
];
|
|
1353
|
-
const $
|
|
1371
|
+
const $a829bc7a11c5e72b$var$ERA_END_DATES = [
|
|
1354
1372
|
[
|
|
1355
1373
|
1912,
|
|
1356
1374
|
7,
|
|
@@ -1372,94 +1390,94 @@ const $4c8188d4ddf4ec96$var$ERA_END_DATES = [
|
|
|
1372
1390
|
30
|
|
1373
1391
|
]
|
|
1374
1392
|
];
|
|
1375
|
-
const $
|
|
1393
|
+
const $a829bc7a11c5e72b$var$ERA_ADDENDS = [
|
|
1376
1394
|
1867,
|
|
1377
1395
|
1911,
|
|
1378
1396
|
1925,
|
|
1379
1397
|
1988,
|
|
1380
1398
|
2018
|
|
1381
1399
|
];
|
|
1382
|
-
const $
|
|
1400
|
+
const $a829bc7a11c5e72b$var$ERA_NAMES = [
|
|
1383
1401
|
'meiji',
|
|
1384
1402
|
'taisho',
|
|
1385
1403
|
'showa',
|
|
1386
1404
|
'heisei',
|
|
1387
1405
|
'reiwa'
|
|
1388
1406
|
];
|
|
1389
|
-
function $
|
|
1390
|
-
const idx = $
|
|
1407
|
+
function $a829bc7a11c5e72b$var$findEraFromGregorianDate(date) {
|
|
1408
|
+
const idx = $a829bc7a11c5e72b$var$ERA_START_DATES.findIndex(([year, month, day])=>{
|
|
1391
1409
|
if (date.year < year) return true;
|
|
1392
1410
|
if (date.year === year && date.month < month) return true;
|
|
1393
1411
|
if (date.year === year && date.month === month && date.day < day) return true;
|
|
1394
1412
|
return false;
|
|
1395
1413
|
});
|
|
1396
|
-
if (idx === -1) return $
|
|
1414
|
+
if (idx === -1) return $a829bc7a11c5e72b$var$ERA_START_DATES.length - 1;
|
|
1397
1415
|
if (idx === 0) return 0;
|
|
1398
1416
|
return idx - 1;
|
|
1399
1417
|
}
|
|
1400
|
-
function $
|
|
1401
|
-
let eraAddend = $
|
|
1418
|
+
function $a829bc7a11c5e72b$var$toGregorian(date) {
|
|
1419
|
+
let eraAddend = $a829bc7a11c5e72b$var$ERA_ADDENDS[$a829bc7a11c5e72b$var$ERA_NAMES.indexOf(date.era)];
|
|
1402
1420
|
if (!eraAddend) throw new Error('Unknown era: ' + date.era);
|
|
1403
|
-
return new $
|
|
1421
|
+
return new $e2d97aa3b7775168$export$99faa760c7908e4f(date.year + eraAddend, date.month, date.day);
|
|
1404
1422
|
}
|
|
1405
|
-
class $
|
|
1423
|
+
class $a829bc7a11c5e72b$export$b746ab2b60cdffbf extends $680b26d521b88d00$export$80ee6245ec4f29ec {
|
|
1406
1424
|
fromJulianDay(jd) {
|
|
1407
1425
|
let date = super.fromJulianDay(jd);
|
|
1408
|
-
let era = $
|
|
1409
|
-
date.era = $
|
|
1410
|
-
date.year -= $
|
|
1426
|
+
let era = $a829bc7a11c5e72b$var$findEraFromGregorianDate(date);
|
|
1427
|
+
date.era = $a829bc7a11c5e72b$var$ERA_NAMES[era];
|
|
1428
|
+
date.year -= $a829bc7a11c5e72b$var$ERA_ADDENDS[era];
|
|
1411
1429
|
return date;
|
|
1412
1430
|
}
|
|
1413
1431
|
toJulianDay(date) {
|
|
1414
|
-
return super.toJulianDay($
|
|
1432
|
+
return super.toJulianDay($a829bc7a11c5e72b$var$toGregorian(date));
|
|
1415
1433
|
}
|
|
1416
1434
|
balanceDate(date) {
|
|
1417
|
-
let gregorianDate = $
|
|
1418
|
-
let era = $
|
|
1419
|
-
if ($
|
|
1420
|
-
date.era = $
|
|
1421
|
-
date.year = gregorianDate.year - $
|
|
1435
|
+
let gregorianDate = $a829bc7a11c5e72b$var$toGregorian(date);
|
|
1436
|
+
let era = $a829bc7a11c5e72b$var$findEraFromGregorianDate(gregorianDate);
|
|
1437
|
+
if ($a829bc7a11c5e72b$var$ERA_NAMES[era] !== date.era) {
|
|
1438
|
+
date.era = $a829bc7a11c5e72b$var$ERA_NAMES[era];
|
|
1439
|
+
date.year = gregorianDate.year - $a829bc7a11c5e72b$var$ERA_ADDENDS[era];
|
|
1422
1440
|
}
|
|
1423
1441
|
}
|
|
1424
1442
|
constrainDate(date) {
|
|
1425
|
-
let idx = $
|
|
1426
|
-
let end = $
|
|
1443
|
+
let idx = $a829bc7a11c5e72b$var$ERA_NAMES.indexOf(date.era);
|
|
1444
|
+
let end = $a829bc7a11c5e72b$var$ERA_END_DATES[idx];
|
|
1427
1445
|
if (end != null) {
|
|
1428
1446
|
let [endYear, endMonth, endDay] = end;
|
|
1429
1447
|
// Constrain the year to the maximum possible value in the era.
|
|
1430
1448
|
// Then constrain the month and day fields within that.
|
|
1431
|
-
let maxYear = endYear - $
|
|
1449
|
+
let maxYear = endYear - $a829bc7a11c5e72b$var$ERA_ADDENDS[idx];
|
|
1432
1450
|
date.year = Math.min(maxYear, date.year);
|
|
1433
1451
|
if (date.year === maxYear) {
|
|
1434
1452
|
date.month = Math.min(endMonth, date.month);
|
|
1435
1453
|
if (date.month === endMonth) date.day = Math.min(endDay, date.day);
|
|
1436
1454
|
}
|
|
1437
1455
|
if (date.year === 1) {
|
|
1438
|
-
let [, startMonth, startDay] = $
|
|
1456
|
+
let [, startMonth, startDay] = $a829bc7a11c5e72b$var$ERA_START_DATES[idx];
|
|
1439
1457
|
date.month = Math.max(startMonth, date.month);
|
|
1440
1458
|
if (date.month === startMonth) date.day = Math.max(startDay, date.day);
|
|
1441
1459
|
}
|
|
1442
1460
|
}
|
|
1443
1461
|
}
|
|
1444
1462
|
getEras() {
|
|
1445
|
-
return $
|
|
1463
|
+
return $a829bc7a11c5e72b$var$ERA_NAMES;
|
|
1446
1464
|
}
|
|
1447
1465
|
getYearsInEra(date) {
|
|
1448
1466
|
// Get the number of years in the era, taking into account the date's month and day fields.
|
|
1449
|
-
let era = $
|
|
1450
|
-
let next = $
|
|
1467
|
+
let era = $a829bc7a11c5e72b$var$ERA_NAMES.indexOf(date.era);
|
|
1468
|
+
let next = $a829bc7a11c5e72b$var$ERA_START_DATES[era + 1];
|
|
1451
1469
|
if (next == null) return 9999;
|
|
1452
|
-
let cur = $
|
|
1470
|
+
let cur = $a829bc7a11c5e72b$var$ERA_START_DATES[era];
|
|
1453
1471
|
let years = next[0] - cur[0];
|
|
1454
1472
|
if (date.month < next[1] || date.month === next[1] && date.day < next[2]) years++;
|
|
1455
1473
|
return years;
|
|
1456
1474
|
}
|
|
1457
1475
|
getMinimumMonthInYear(date) {
|
|
1458
|
-
let start = $
|
|
1476
|
+
let start = $a829bc7a11c5e72b$var$getMinimums(date);
|
|
1459
1477
|
return start ? start[1] : 1;
|
|
1460
1478
|
}
|
|
1461
1479
|
getMinimumDayInMonth(date) {
|
|
1462
|
-
let start = $
|
|
1480
|
+
let start = $a829bc7a11c5e72b$var$getMinimums(date);
|
|
1463
1481
|
return start && date.month === start[1] ? start[2] : 1;
|
|
1464
1482
|
}
|
|
1465
1483
|
constructor(...args){
|
|
@@ -1467,25 +1485,25 @@ class $4c8188d4ddf4ec96$export$b746ab2b60cdffbf extends $5adb4cba079e6f7b$export
|
|
|
1467
1485
|
this.identifier = 'japanese';
|
|
1468
1486
|
}
|
|
1469
1487
|
}
|
|
1470
|
-
function $
|
|
1488
|
+
function $a829bc7a11c5e72b$var$getMinimums(date) {
|
|
1471
1489
|
if (date.year === 1) {
|
|
1472
|
-
let idx = $
|
|
1473
|
-
return $
|
|
1490
|
+
let idx = $a829bc7a11c5e72b$var$ERA_NAMES.indexOf(date.era);
|
|
1491
|
+
return $a829bc7a11c5e72b$var$ERA_START_DATES[idx];
|
|
1474
1492
|
}
|
|
1475
1493
|
}
|
|
1476
1494
|
|
|
1477
1495
|
|
|
1478
1496
|
|
|
1479
1497
|
|
|
1480
|
-
const $
|
|
1481
|
-
class $
|
|
1498
|
+
const $3d8b8d698eadd9f9$var$BUDDHIST_ERA_START = -543;
|
|
1499
|
+
class $3d8b8d698eadd9f9$export$42d20a78301dee44 extends $680b26d521b88d00$export$80ee6245ec4f29ec {
|
|
1482
1500
|
fromJulianDay(jd) {
|
|
1483
1501
|
let date = super.fromJulianDay(jd);
|
|
1484
|
-
date.year -= $
|
|
1502
|
+
date.year -= $3d8b8d698eadd9f9$var$BUDDHIST_ERA_START;
|
|
1485
1503
|
return date;
|
|
1486
1504
|
}
|
|
1487
1505
|
toJulianDay(date) {
|
|
1488
|
-
return super.toJulianDay(new $
|
|
1506
|
+
return super.toJulianDay(new $e2d97aa3b7775168$export$99faa760c7908e4f(date.year + $3d8b8d698eadd9f9$var$BUDDHIST_ERA_START, date.month, date.day));
|
|
1489
1507
|
}
|
|
1490
1508
|
getEras() {
|
|
1491
1509
|
return [
|
|
@@ -1501,12 +1519,12 @@ class $b20daff49d96eb86$export$42d20a78301dee44 extends $5adb4cba079e6f7b$export
|
|
|
1501
1519
|
|
|
1502
1520
|
|
|
1503
1521
|
|
|
1504
|
-
const $
|
|
1505
|
-
function $
|
|
1506
|
-
return date.era === 'minguo' ? date.year + $
|
|
1522
|
+
const $3787fdcbabdfc7bd$var$TAIWAN_ERA_START = 1911;
|
|
1523
|
+
function $3787fdcbabdfc7bd$var$gregorianYear(date) {
|
|
1524
|
+
return date.era === 'minguo' ? date.year + $3787fdcbabdfc7bd$var$TAIWAN_ERA_START : 1 - date.year + $3787fdcbabdfc7bd$var$TAIWAN_ERA_START;
|
|
1507
1525
|
}
|
|
1508
|
-
function $
|
|
1509
|
-
let y = year - $
|
|
1526
|
+
function $3787fdcbabdfc7bd$var$gregorianToTaiwan(year, date) {
|
|
1527
|
+
let y = year - $3787fdcbabdfc7bd$var$TAIWAN_ERA_START;
|
|
1510
1528
|
if (y > 0) {
|
|
1511
1529
|
date.era = 'minguo';
|
|
1512
1530
|
date.year = y;
|
|
@@ -1515,14 +1533,14 @@ function $0034fbb09326c982$var$gregorianToTaiwan(year, date) {
|
|
|
1515
1533
|
date.year = 1 - y;
|
|
1516
1534
|
}
|
|
1517
1535
|
}
|
|
1518
|
-
class $
|
|
1536
|
+
class $3787fdcbabdfc7bd$export$65e01080afcb0799 extends $680b26d521b88d00$export$80ee6245ec4f29ec {
|
|
1519
1537
|
fromJulianDay(jd) {
|
|
1520
1538
|
let date = super.fromJulianDay(jd);
|
|
1521
|
-
$
|
|
1539
|
+
$3787fdcbabdfc7bd$var$gregorianToTaiwan(date.year, date);
|
|
1522
1540
|
return date;
|
|
1523
1541
|
}
|
|
1524
1542
|
toJulianDay(date) {
|
|
1525
|
-
return super.toJulianDay(new $
|
|
1543
|
+
return super.toJulianDay(new $e2d97aa3b7775168$export$99faa760c7908e4f($3787fdcbabdfc7bd$var$gregorianYear(date), date.month, date.day));
|
|
1526
1544
|
}
|
|
1527
1545
|
getEras() {
|
|
1528
1546
|
return [
|
|
@@ -1531,7 +1549,7 @@ class $0034fbb09326c982$export$65e01080afcb0799 extends $5adb4cba079e6f7b$export
|
|
|
1531
1549
|
];
|
|
1532
1550
|
}
|
|
1533
1551
|
balanceDate(date) {
|
|
1534
|
-
$
|
|
1552
|
+
$3787fdcbabdfc7bd$var$gregorianToTaiwan($3787fdcbabdfc7bd$var$gregorianYear(date), date);
|
|
1535
1553
|
}
|
|
1536
1554
|
getYearsToAdd(date, years) {
|
|
1537
1555
|
return date.era === 'before_minguo' ? -years : years;
|
|
@@ -1546,33 +1564,33 @@ class $0034fbb09326c982$export$65e01080afcb0799 extends $5adb4cba079e6f7b$export
|
|
|
1546
1564
|
|
|
1547
1565
|
|
|
1548
1566
|
|
|
1549
|
-
const $
|
|
1550
|
-
function $
|
|
1567
|
+
const $75fdc3cae9bb671c$var$PERSIAN_EPOCH = 1948321; // 622/03/19 Julian C.E.
|
|
1568
|
+
function $75fdc3cae9bb671c$var$isLeapYear(year) {
|
|
1551
1569
|
let y0 = year > 0 ? year - 474 : year - 473;
|
|
1552
|
-
let y1 = $
|
|
1553
|
-
return $
|
|
1570
|
+
let y1 = $126da7c1075fa25c$export$842a2cf37af977e1(y0, 2820) + 474;
|
|
1571
|
+
return $126da7c1075fa25c$export$842a2cf37af977e1((y1 + 38) * 31, 128) < 31;
|
|
1554
1572
|
}
|
|
1555
|
-
function $
|
|
1573
|
+
function $75fdc3cae9bb671c$var$persianToJulianDay(year, month, day) {
|
|
1556
1574
|
let y0 = year > 0 ? year - 474 : year - 473;
|
|
1557
|
-
let y1 = $
|
|
1575
|
+
let y1 = $126da7c1075fa25c$export$842a2cf37af977e1(y0, 2820) + 474;
|
|
1558
1576
|
let offset = month <= 7 ? 31 * (month - 1) : 30 * (month - 1) + 6;
|
|
1559
|
-
return $
|
|
1577
|
+
return $75fdc3cae9bb671c$var$PERSIAN_EPOCH - 1 + 1029983 * Math.floor(y0 / 2820) + 365 * (y1 - 1) + Math.floor((31 * y1 - 5) / 128) + offset + day;
|
|
1560
1578
|
}
|
|
1561
|
-
class $
|
|
1579
|
+
class $75fdc3cae9bb671c$export$37fccdbfd14c5939 {
|
|
1562
1580
|
fromJulianDay(jd) {
|
|
1563
|
-
let d0 = jd - $
|
|
1581
|
+
let d0 = jd - $75fdc3cae9bb671c$var$persianToJulianDay(475, 1, 1);
|
|
1564
1582
|
let n2820 = Math.floor(d0 / 1029983);
|
|
1565
|
-
let d1 = $
|
|
1583
|
+
let d1 = $126da7c1075fa25c$export$842a2cf37af977e1(d0, 1029983);
|
|
1566
1584
|
let y2820 = d1 === 1029982 ? 2820 : Math.floor((128 * d1 + 46878) / 46751);
|
|
1567
1585
|
let year = 474 + 2820 * n2820 + y2820;
|
|
1568
1586
|
if (year <= 0) year--;
|
|
1569
|
-
let yDay = jd - $
|
|
1587
|
+
let yDay = jd - $75fdc3cae9bb671c$var$persianToJulianDay(year, 1, 1) + 1;
|
|
1570
1588
|
let month = yDay <= 186 ? Math.ceil(yDay / 31) : Math.ceil((yDay - 6) / 31);
|
|
1571
|
-
let day = jd - $
|
|
1572
|
-
return new $
|
|
1589
|
+
let day = jd - $75fdc3cae9bb671c$var$persianToJulianDay(year, month, 1) + 1;
|
|
1590
|
+
return new $e2d97aa3b7775168$export$99faa760c7908e4f(this, year, month, day);
|
|
1573
1591
|
}
|
|
1574
1592
|
toJulianDay(date) {
|
|
1575
|
-
return $
|
|
1593
|
+
return $75fdc3cae9bb671c$var$persianToJulianDay(date.year, date.month, date.day);
|
|
1576
1594
|
}
|
|
1577
1595
|
getMonthsInYear() {
|
|
1578
1596
|
return 12;
|
|
@@ -1580,7 +1598,7 @@ class $cae8dbfeeb52b26c$export$37fccdbfd14c5939 {
|
|
|
1580
1598
|
getDaysInMonth(date) {
|
|
1581
1599
|
if (date.month <= 6) return 31;
|
|
1582
1600
|
if (date.month <= 11) return 30;
|
|
1583
|
-
return $
|
|
1601
|
+
return $75fdc3cae9bb671c$var$isLeapYear(date.year) ? 30 : 29;
|
|
1584
1602
|
}
|
|
1585
1603
|
getEras() {
|
|
1586
1604
|
return [
|
|
@@ -1599,28 +1617,28 @@ class $cae8dbfeeb52b26c$export$37fccdbfd14c5939 {
|
|
|
1599
1617
|
|
|
1600
1618
|
|
|
1601
1619
|
// Starts in 78 AD,
|
|
1602
|
-
const $
|
|
1620
|
+
const $8626c25ab1e2c78a$var$INDIAN_ERA_START = 78;
|
|
1603
1621
|
// The Indian year starts 80 days later than the Gregorian year.
|
|
1604
|
-
const $
|
|
1605
|
-
class $
|
|
1622
|
+
const $8626c25ab1e2c78a$var$INDIAN_YEAR_START = 80;
|
|
1623
|
+
class $8626c25ab1e2c78a$export$39f31c639fa15726 extends $680b26d521b88d00$export$80ee6245ec4f29ec {
|
|
1606
1624
|
fromJulianDay(jd) {
|
|
1607
1625
|
// Gregorian date for Julian day
|
|
1608
1626
|
let date = super.fromJulianDay(jd);
|
|
1609
1627
|
// Year in Saka era
|
|
1610
|
-
let indianYear = date.year - $
|
|
1628
|
+
let indianYear = date.year - $8626c25ab1e2c78a$var$INDIAN_ERA_START;
|
|
1611
1629
|
// Day number in Gregorian year (starting from 0)
|
|
1612
|
-
let yDay = jd - $
|
|
1630
|
+
let yDay = jd - $680b26d521b88d00$export$f297eb839006d339(date.year, 1, 1);
|
|
1613
1631
|
let leapMonth;
|
|
1614
|
-
if (yDay < $
|
|
1632
|
+
if (yDay < $8626c25ab1e2c78a$var$INDIAN_YEAR_START) {
|
|
1615
1633
|
// Day is at the end of the preceding Saka year
|
|
1616
1634
|
indianYear--;
|
|
1617
1635
|
// Days in leapMonth this year, previous Gregorian year
|
|
1618
|
-
leapMonth = $
|
|
1636
|
+
leapMonth = $680b26d521b88d00$export$553d7fa8e3805fc0(date.year - 1) ? 31 : 30;
|
|
1619
1637
|
yDay += leapMonth + 155 + 90 + 10;
|
|
1620
1638
|
} else {
|
|
1621
1639
|
// Days in leapMonth this year
|
|
1622
|
-
leapMonth = $
|
|
1623
|
-
yDay -= $
|
|
1640
|
+
leapMonth = $680b26d521b88d00$export$553d7fa8e3805fc0(date.year) ? 31 : 30;
|
|
1641
|
+
yDay -= $8626c25ab1e2c78a$var$INDIAN_YEAR_START;
|
|
1624
1642
|
}
|
|
1625
1643
|
let indianMonth;
|
|
1626
1644
|
let indianDay;
|
|
@@ -1638,18 +1656,18 @@ class $8f8e08f6046dcac2$export$39f31c639fa15726 extends $5adb4cba079e6f7b$export
|
|
|
1638
1656
|
indianDay = mDay % 30 + 1;
|
|
1639
1657
|
}
|
|
1640
1658
|
}
|
|
1641
|
-
return new $
|
|
1659
|
+
return new $e2d97aa3b7775168$export$99faa760c7908e4f(this, indianYear, indianMonth, indianDay);
|
|
1642
1660
|
}
|
|
1643
1661
|
toJulianDay(date) {
|
|
1644
|
-
let year = date.year + $
|
|
1662
|
+
let year = date.year + $8626c25ab1e2c78a$var$INDIAN_ERA_START;
|
|
1645
1663
|
let leapMonth;
|
|
1646
1664
|
let jd;
|
|
1647
|
-
if ($
|
|
1665
|
+
if ($680b26d521b88d00$export$553d7fa8e3805fc0(year)) {
|
|
1648
1666
|
leapMonth = 31;
|
|
1649
|
-
jd = $
|
|
1667
|
+
jd = $680b26d521b88d00$export$f297eb839006d339(year, 3, 21);
|
|
1650
1668
|
} else {
|
|
1651
1669
|
leapMonth = 30;
|
|
1652
|
-
jd = $
|
|
1670
|
+
jd = $680b26d521b88d00$export$f297eb839006d339(year, 3, 22);
|
|
1653
1671
|
}
|
|
1654
1672
|
if (date.month === 1) return jd + date.day - 1;
|
|
1655
1673
|
jd += leapMonth + Math.min(date.month - 2, 5) * 31;
|
|
@@ -1658,7 +1676,7 @@ class $8f8e08f6046dcac2$export$39f31c639fa15726 extends $5adb4cba079e6f7b$export
|
|
|
1658
1676
|
return jd;
|
|
1659
1677
|
}
|
|
1660
1678
|
getDaysInMonth(date) {
|
|
1661
|
-
if (date.month === 1 && $
|
|
1679
|
+
if (date.month === 1 && $680b26d521b88d00$export$553d7fa8e3805fc0(date.year + $8626c25ab1e2c78a$var$INDIAN_ERA_START)) return 31;
|
|
1662
1680
|
if (date.month >= 2 && date.month <= 6) return 31;
|
|
1663
1681
|
return 30;
|
|
1664
1682
|
}
|
|
@@ -1678,40 +1696,40 @@ class $8f8e08f6046dcac2$export$39f31c639fa15726 extends $5adb4cba079e6f7b$export
|
|
|
1678
1696
|
|
|
1679
1697
|
|
|
1680
1698
|
|
|
1681
|
-
const $
|
|
1682
|
-
const $
|
|
1683
|
-
const $
|
|
1684
|
-
const $
|
|
1685
|
-
const $
|
|
1686
|
-
function $
|
|
1699
|
+
const $4f37d2a9fc47c3f0$var$CIVIL_EPOC = 1948440; // CE 622 July 16 Friday (Julian calendar) / CE 622 July 19 (Gregorian calendar)
|
|
1700
|
+
const $4f37d2a9fc47c3f0$var$ASTRONOMICAL_EPOC = 1948439; // CE 622 July 15 Thursday (Julian calendar)
|
|
1701
|
+
const $4f37d2a9fc47c3f0$var$UMALQURA_YEAR_START = 1300;
|
|
1702
|
+
const $4f37d2a9fc47c3f0$var$UMALQURA_YEAR_END = 1600;
|
|
1703
|
+
const $4f37d2a9fc47c3f0$var$UMALQURA_START_DAYS = 460322;
|
|
1704
|
+
function $4f37d2a9fc47c3f0$var$islamicToJulianDay(epoch, year, month, day) {
|
|
1687
1705
|
return day + Math.ceil(29.5 * (month - 1)) + (year - 1) * 354 + Math.floor((3 + 11 * year) / 30) + epoch - 1;
|
|
1688
1706
|
}
|
|
1689
|
-
function $
|
|
1707
|
+
function $4f37d2a9fc47c3f0$var$julianDayToIslamic(calendar, epoch, jd) {
|
|
1690
1708
|
let year = Math.floor((30 * (jd - epoch) + 10646) / 10631);
|
|
1691
|
-
let month = Math.min(12, Math.ceil((jd - (29 + $
|
|
1692
|
-
let day = jd - $
|
|
1693
|
-
return new $
|
|
1709
|
+
let month = Math.min(12, Math.ceil((jd - (29 + $4f37d2a9fc47c3f0$var$islamicToJulianDay(epoch, year, 1, 1))) / 29.5) + 1);
|
|
1710
|
+
let day = jd - $4f37d2a9fc47c3f0$var$islamicToJulianDay(epoch, year, month, 1) + 1;
|
|
1711
|
+
return new $e2d97aa3b7775168$export$99faa760c7908e4f(calendar, year, month, day);
|
|
1694
1712
|
}
|
|
1695
|
-
function $
|
|
1713
|
+
function $4f37d2a9fc47c3f0$var$isLeapYear(year) {
|
|
1696
1714
|
return (14 + 11 * year) % 30 < 11;
|
|
1697
1715
|
}
|
|
1698
|
-
class $
|
|
1716
|
+
class $4f37d2a9fc47c3f0$export$2066795aadd37bfc {
|
|
1699
1717
|
fromJulianDay(jd) {
|
|
1700
|
-
return $
|
|
1718
|
+
return $4f37d2a9fc47c3f0$var$julianDayToIslamic(this, $4f37d2a9fc47c3f0$var$CIVIL_EPOC, jd);
|
|
1701
1719
|
}
|
|
1702
1720
|
toJulianDay(date) {
|
|
1703
|
-
return $
|
|
1721
|
+
return $4f37d2a9fc47c3f0$var$islamicToJulianDay($4f37d2a9fc47c3f0$var$CIVIL_EPOC, date.year, date.month, date.day);
|
|
1704
1722
|
}
|
|
1705
1723
|
getDaysInMonth(date) {
|
|
1706
1724
|
let length = 29 + date.month % 2;
|
|
1707
|
-
if (date.month === 12 && $
|
|
1725
|
+
if (date.month === 12 && $4f37d2a9fc47c3f0$var$isLeapYear(date.year)) length++;
|
|
1708
1726
|
return length;
|
|
1709
1727
|
}
|
|
1710
1728
|
getMonthsInYear() {
|
|
1711
1729
|
return 12;
|
|
1712
1730
|
}
|
|
1713
1731
|
getDaysInYear(date) {
|
|
1714
|
-
return $
|
|
1732
|
+
return $4f37d2a9fc47c3f0$var$isLeapYear(date.year) ? 355 : 354;
|
|
1715
1733
|
}
|
|
1716
1734
|
getYearsInEra() {
|
|
1717
1735
|
return 9999;
|
|
@@ -1725,12 +1743,12 @@ class $8ba87b21dd897347$export$2066795aadd37bfc {
|
|
|
1725
1743
|
this.identifier = 'islamic-civil';
|
|
1726
1744
|
}
|
|
1727
1745
|
}
|
|
1728
|
-
class $
|
|
1746
|
+
class $4f37d2a9fc47c3f0$export$37f0887f2f9d22f7 extends $4f37d2a9fc47c3f0$export$2066795aadd37bfc {
|
|
1729
1747
|
fromJulianDay(jd) {
|
|
1730
|
-
return $
|
|
1748
|
+
return $4f37d2a9fc47c3f0$var$julianDayToIslamic(this, $4f37d2a9fc47c3f0$var$ASTRONOMICAL_EPOC, jd);
|
|
1731
1749
|
}
|
|
1732
1750
|
toJulianDay(date) {
|
|
1733
|
-
return $
|
|
1751
|
+
return $4f37d2a9fc47c3f0$var$islamicToJulianDay($4f37d2a9fc47c3f0$var$ASTRONOMICAL_EPOC, date.year, date.month, date.day);
|
|
1734
1752
|
}
|
|
1735
1753
|
constructor(...args){
|
|
1736
1754
|
super(...args);
|
|
@@ -1738,128 +1756,128 @@ class $8ba87b21dd897347$export$37f0887f2f9d22f7 extends $8ba87b21dd897347$export
|
|
|
1738
1756
|
}
|
|
1739
1757
|
}
|
|
1740
1758
|
// Generated by scripts/generate-umalqura.js
|
|
1741
|
-
const $
|
|
1742
|
-
let $
|
|
1743
|
-
let $
|
|
1744
|
-
function $
|
|
1745
|
-
return $
|
|
1746
|
-
}
|
|
1747
|
-
function $
|
|
1748
|
-
let idx = year - $
|
|
1759
|
+
const $4f37d2a9fc47c3f0$var$UMALQURA_DATA = 'qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI=';
|
|
1760
|
+
let $4f37d2a9fc47c3f0$var$UMALQURA_MONTHLENGTH;
|
|
1761
|
+
let $4f37d2a9fc47c3f0$var$UMALQURA_YEAR_START_TABLE;
|
|
1762
|
+
function $4f37d2a9fc47c3f0$var$umalquraYearStart(year) {
|
|
1763
|
+
return $4f37d2a9fc47c3f0$var$UMALQURA_START_DAYS + $4f37d2a9fc47c3f0$var$UMALQURA_YEAR_START_TABLE[year - $4f37d2a9fc47c3f0$var$UMALQURA_YEAR_START];
|
|
1764
|
+
}
|
|
1765
|
+
function $4f37d2a9fc47c3f0$var$umalquraMonthLength(year, month) {
|
|
1766
|
+
let idx = year - $4f37d2a9fc47c3f0$var$UMALQURA_YEAR_START;
|
|
1749
1767
|
let mask = 1 << 11 - (month - 1);
|
|
1750
|
-
if (($
|
|
1768
|
+
if (($4f37d2a9fc47c3f0$var$UMALQURA_MONTHLENGTH[idx] & mask) === 0) return 29;
|
|
1751
1769
|
else return 30;
|
|
1752
1770
|
}
|
|
1753
|
-
function $
|
|
1754
|
-
let day = $
|
|
1755
|
-
for(let i = 1; i < month; i++)day += $
|
|
1771
|
+
function $4f37d2a9fc47c3f0$var$umalquraMonthStart(year, month) {
|
|
1772
|
+
let day = $4f37d2a9fc47c3f0$var$umalquraYearStart(year);
|
|
1773
|
+
for(let i = 1; i < month; i++)day += $4f37d2a9fc47c3f0$var$umalquraMonthLength(year, i);
|
|
1756
1774
|
return day;
|
|
1757
1775
|
}
|
|
1758
|
-
function $
|
|
1759
|
-
return $
|
|
1776
|
+
function $4f37d2a9fc47c3f0$var$umalquraYearLength(year) {
|
|
1777
|
+
return $4f37d2a9fc47c3f0$var$UMALQURA_YEAR_START_TABLE[year + 1 - $4f37d2a9fc47c3f0$var$UMALQURA_YEAR_START] - $4f37d2a9fc47c3f0$var$UMALQURA_YEAR_START_TABLE[year - $4f37d2a9fc47c3f0$var$UMALQURA_YEAR_START];
|
|
1760
1778
|
}
|
|
1761
|
-
class $
|
|
1762
|
-
constructor(){
|
|
1763
|
-
super();
|
|
1764
|
-
this.identifier = 'islamic-umalqura';
|
|
1765
|
-
if (!$8ba87b21dd897347$var$UMALQURA_MONTHLENGTH) $8ba87b21dd897347$var$UMALQURA_MONTHLENGTH = new Uint16Array(Uint8Array.from(atob($8ba87b21dd897347$var$UMALQURA_DATA), (c)=>c.charCodeAt(0)
|
|
1766
|
-
).buffer);
|
|
1767
|
-
if (!$8ba87b21dd897347$var$UMALQURA_YEAR_START_TABLE) {
|
|
1768
|
-
$8ba87b21dd897347$var$UMALQURA_YEAR_START_TABLE = new Uint32Array($8ba87b21dd897347$var$UMALQURA_YEAR_END - $8ba87b21dd897347$var$UMALQURA_YEAR_START + 1);
|
|
1769
|
-
let yearStart = 0;
|
|
1770
|
-
for(let year = $8ba87b21dd897347$var$UMALQURA_YEAR_START; year <= $8ba87b21dd897347$var$UMALQURA_YEAR_END; year++){
|
|
1771
|
-
$8ba87b21dd897347$var$UMALQURA_YEAR_START_TABLE[year - $8ba87b21dd897347$var$UMALQURA_YEAR_START] = yearStart;
|
|
1772
|
-
for(let i = 1; i <= 12; i++)yearStart += $8ba87b21dd897347$var$umalquraMonthLength(year, i);
|
|
1773
|
-
}
|
|
1774
|
-
}
|
|
1775
|
-
}
|
|
1779
|
+
class $4f37d2a9fc47c3f0$export$5baab4758c231076 extends $4f37d2a9fc47c3f0$export$2066795aadd37bfc {
|
|
1776
1780
|
fromJulianDay(jd) {
|
|
1777
|
-
let days = jd - $
|
|
1778
|
-
let startDays = $
|
|
1779
|
-
let endDays = $
|
|
1781
|
+
let days = jd - $4f37d2a9fc47c3f0$var$CIVIL_EPOC;
|
|
1782
|
+
let startDays = $4f37d2a9fc47c3f0$var$umalquraYearStart($4f37d2a9fc47c3f0$var$UMALQURA_YEAR_START);
|
|
1783
|
+
let endDays = $4f37d2a9fc47c3f0$var$umalquraYearStart($4f37d2a9fc47c3f0$var$UMALQURA_YEAR_END);
|
|
1780
1784
|
if (days < startDays || days > endDays) return super.fromJulianDay(jd);
|
|
1781
1785
|
else {
|
|
1782
|
-
let y = $
|
|
1786
|
+
let y = $4f37d2a9fc47c3f0$var$UMALQURA_YEAR_START - 1;
|
|
1783
1787
|
let m = 1;
|
|
1784
1788
|
let d = 1;
|
|
1785
1789
|
while(d > 0){
|
|
1786
1790
|
y++;
|
|
1787
|
-
d = days - $
|
|
1788
|
-
let yearLength = $
|
|
1791
|
+
d = days - $4f37d2a9fc47c3f0$var$umalquraYearStart(y) + 1;
|
|
1792
|
+
let yearLength = $4f37d2a9fc47c3f0$var$umalquraYearLength(y);
|
|
1789
1793
|
if (d === yearLength) {
|
|
1790
1794
|
m = 12;
|
|
1791
1795
|
break;
|
|
1792
1796
|
} else if (d < yearLength) {
|
|
1793
|
-
let monthLength = $
|
|
1797
|
+
let monthLength = $4f37d2a9fc47c3f0$var$umalquraMonthLength(y, m);
|
|
1794
1798
|
m = 1;
|
|
1795
1799
|
while(d > monthLength){
|
|
1796
1800
|
d -= monthLength;
|
|
1797
1801
|
m++;
|
|
1798
|
-
monthLength = $
|
|
1802
|
+
monthLength = $4f37d2a9fc47c3f0$var$umalquraMonthLength(y, m);
|
|
1799
1803
|
}
|
|
1800
1804
|
break;
|
|
1801
1805
|
}
|
|
1802
1806
|
}
|
|
1803
|
-
return new $
|
|
1807
|
+
return new $e2d97aa3b7775168$export$99faa760c7908e4f(this, y, m, days - $4f37d2a9fc47c3f0$var$umalquraMonthStart(y, m) + 1);
|
|
1804
1808
|
}
|
|
1805
1809
|
}
|
|
1806
1810
|
toJulianDay(date) {
|
|
1807
|
-
if (date.year < $
|
|
1808
|
-
return $
|
|
1811
|
+
if (date.year < $4f37d2a9fc47c3f0$var$UMALQURA_YEAR_START || date.year > $4f37d2a9fc47c3f0$var$UMALQURA_YEAR_END) return super.toJulianDay(date);
|
|
1812
|
+
return $4f37d2a9fc47c3f0$var$CIVIL_EPOC + $4f37d2a9fc47c3f0$var$umalquraMonthStart(date.year, date.month) + (date.day - 1);
|
|
1809
1813
|
}
|
|
1810
1814
|
getDaysInMonth(date) {
|
|
1811
|
-
if (date.year < $
|
|
1812
|
-
return $
|
|
1815
|
+
if (date.year < $4f37d2a9fc47c3f0$var$UMALQURA_YEAR_START || date.year > $4f37d2a9fc47c3f0$var$UMALQURA_YEAR_END) return super.getDaysInMonth(date);
|
|
1816
|
+
return $4f37d2a9fc47c3f0$var$umalquraMonthLength(date.year, date.month);
|
|
1813
1817
|
}
|
|
1814
1818
|
getDaysInYear(date) {
|
|
1815
|
-
if (date.year < $
|
|
1816
|
-
return $
|
|
1819
|
+
if (date.year < $4f37d2a9fc47c3f0$var$UMALQURA_YEAR_START || date.year > $4f37d2a9fc47c3f0$var$UMALQURA_YEAR_END) return super.getDaysInYear(date);
|
|
1820
|
+
return $4f37d2a9fc47c3f0$var$umalquraYearLength(date.year);
|
|
1821
|
+
}
|
|
1822
|
+
constructor(){
|
|
1823
|
+
super();
|
|
1824
|
+
this.identifier = 'islamic-umalqura';
|
|
1825
|
+
if (!$4f37d2a9fc47c3f0$var$UMALQURA_MONTHLENGTH) $4f37d2a9fc47c3f0$var$UMALQURA_MONTHLENGTH = new Uint16Array(Uint8Array.from(atob($4f37d2a9fc47c3f0$var$UMALQURA_DATA), (c)=>c.charCodeAt(0)
|
|
1826
|
+
).buffer);
|
|
1827
|
+
if (!$4f37d2a9fc47c3f0$var$UMALQURA_YEAR_START_TABLE) {
|
|
1828
|
+
$4f37d2a9fc47c3f0$var$UMALQURA_YEAR_START_TABLE = new Uint32Array($4f37d2a9fc47c3f0$var$UMALQURA_YEAR_END - $4f37d2a9fc47c3f0$var$UMALQURA_YEAR_START + 1);
|
|
1829
|
+
let yearStart = 0;
|
|
1830
|
+
for(let year = $4f37d2a9fc47c3f0$var$UMALQURA_YEAR_START; year <= $4f37d2a9fc47c3f0$var$UMALQURA_YEAR_END; year++){
|
|
1831
|
+
$4f37d2a9fc47c3f0$var$UMALQURA_YEAR_START_TABLE[year - $4f37d2a9fc47c3f0$var$UMALQURA_YEAR_START] = yearStart;
|
|
1832
|
+
for(let i = 1; i <= 12; i++)yearStart += $4f37d2a9fc47c3f0$var$umalquraMonthLength(year, i);
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1817
1835
|
}
|
|
1818
1836
|
}
|
|
1819
1837
|
|
|
1820
1838
|
|
|
1821
1839
|
|
|
1822
1840
|
|
|
1823
|
-
const $
|
|
1841
|
+
const $7e9e96397d8405f3$var$HEBREW_EPOCH = 347997;
|
|
1824
1842
|
// Hebrew date calculations are performed in terms of days, hours, and
|
|
1825
1843
|
// "parts" (or halakim), which are 1/1080 of an hour, or 3 1/3 seconds.
|
|
1826
|
-
const $
|
|
1827
|
-
const $
|
|
1844
|
+
const $7e9e96397d8405f3$var$HOUR_PARTS = 1080;
|
|
1845
|
+
const $7e9e96397d8405f3$var$DAY_PARTS = 24 * $7e9e96397d8405f3$var$HOUR_PARTS;
|
|
1828
1846
|
// An approximate value for the length of a lunar month.
|
|
1829
1847
|
// It is used to calculate the approximate year and month of a given
|
|
1830
1848
|
// absolute date.
|
|
1831
|
-
const $
|
|
1832
|
-
const $
|
|
1833
|
-
const $
|
|
1834
|
-
function $
|
|
1835
|
-
return $
|
|
1849
|
+
const $7e9e96397d8405f3$var$MONTH_DAYS = 29;
|
|
1850
|
+
const $7e9e96397d8405f3$var$MONTH_FRACT = 12 * $7e9e96397d8405f3$var$HOUR_PARTS + 793;
|
|
1851
|
+
const $7e9e96397d8405f3$var$MONTH_PARTS = $7e9e96397d8405f3$var$MONTH_DAYS * $7e9e96397d8405f3$var$DAY_PARTS + $7e9e96397d8405f3$var$MONTH_FRACT;
|
|
1852
|
+
function $7e9e96397d8405f3$var$isLeapYear(year) {
|
|
1853
|
+
return $126da7c1075fa25c$export$842a2cf37af977e1(year * 7 + 1, 19) < 7;
|
|
1836
1854
|
}
|
|
1837
1855
|
// Test for delay of start of new year and to avoid
|
|
1838
1856
|
// Sunday, Wednesday, and Friday as start of the new year.
|
|
1839
|
-
function $
|
|
1857
|
+
function $7e9e96397d8405f3$var$hebrewDelay1(year) {
|
|
1840
1858
|
let months = Math.floor((235 * year - 234) / 19);
|
|
1841
1859
|
let parts = 12084 + 13753 * months;
|
|
1842
1860
|
let day = months * 29 + Math.floor(parts / 25920);
|
|
1843
|
-
if ($
|
|
1861
|
+
if ($126da7c1075fa25c$export$842a2cf37af977e1(3 * (day + 1), 7) < 3) day += 1;
|
|
1844
1862
|
return day;
|
|
1845
1863
|
}
|
|
1846
1864
|
// Check for delay in start of new year due to length of adjacent years
|
|
1847
|
-
function $
|
|
1848
|
-
let last = $
|
|
1849
|
-
let present = $
|
|
1850
|
-
let next = $
|
|
1865
|
+
function $7e9e96397d8405f3$var$hebrewDelay2(year) {
|
|
1866
|
+
let last = $7e9e96397d8405f3$var$hebrewDelay1(year - 1);
|
|
1867
|
+
let present = $7e9e96397d8405f3$var$hebrewDelay1(year);
|
|
1868
|
+
let next = $7e9e96397d8405f3$var$hebrewDelay1(year + 1);
|
|
1851
1869
|
if (next - present === 356) return 2;
|
|
1852
1870
|
if (present - last === 382) return 1;
|
|
1853
1871
|
return 0;
|
|
1854
1872
|
}
|
|
1855
|
-
function $
|
|
1856
|
-
return $
|
|
1873
|
+
function $7e9e96397d8405f3$var$startOfYear(year) {
|
|
1874
|
+
return $7e9e96397d8405f3$var$hebrewDelay1(year) + $7e9e96397d8405f3$var$hebrewDelay2(year);
|
|
1857
1875
|
}
|
|
1858
|
-
function $
|
|
1859
|
-
return $
|
|
1876
|
+
function $7e9e96397d8405f3$var$getDaysInYear(year) {
|
|
1877
|
+
return $7e9e96397d8405f3$var$startOfYear(year + 1) - $7e9e96397d8405f3$var$startOfYear(year);
|
|
1860
1878
|
}
|
|
1861
|
-
function $
|
|
1862
|
-
let yearLength = $
|
|
1879
|
+
function $7e9e96397d8405f3$var$getYearType(year) {
|
|
1880
|
+
let yearLength = $7e9e96397d8405f3$var$getDaysInYear(year);
|
|
1863
1881
|
if (yearLength > 380) yearLength -= 30; // Subtract length of leap month.
|
|
1864
1882
|
switch(yearLength){
|
|
1865
1883
|
case 353:
|
|
@@ -1870,58 +1888,58 @@ function $33f6c3bb549d8eee$var$getYearType(year) {
|
|
|
1870
1888
|
return 2; // complete
|
|
1871
1889
|
}
|
|
1872
1890
|
}
|
|
1873
|
-
function $
|
|
1891
|
+
function $7e9e96397d8405f3$var$getDaysInMonth(year, month) {
|
|
1874
1892
|
// Normalize month numbers from 1 - 13, even on non-leap years
|
|
1875
|
-
if (month >= 6 && !$
|
|
1893
|
+
if (month >= 6 && !$7e9e96397d8405f3$var$isLeapYear(year)) month++;
|
|
1876
1894
|
// First of all, dispose of fixed-length 29 day months
|
|
1877
1895
|
if (month === 4 || month === 7 || month === 9 || month === 11 || month === 13) return 29;
|
|
1878
|
-
let yearType = $
|
|
1896
|
+
let yearType = $7e9e96397d8405f3$var$getYearType(year);
|
|
1879
1897
|
// If it's Heshvan, days depend on length of year
|
|
1880
1898
|
if (month === 2) return yearType === 2 ? 30 : 29;
|
|
1881
1899
|
// Similarly, Kislev varies with the length of year
|
|
1882
1900
|
if (month === 3) return yearType === 0 ? 29 : 30;
|
|
1883
1901
|
// Adar I only exists in leap years
|
|
1884
|
-
if (month === 6) return $
|
|
1902
|
+
if (month === 6) return $7e9e96397d8405f3$var$isLeapYear(year) ? 30 : 0;
|
|
1885
1903
|
return 30;
|
|
1886
1904
|
}
|
|
1887
|
-
class $
|
|
1905
|
+
class $7e9e96397d8405f3$export$ca405048b8fb5af {
|
|
1888
1906
|
fromJulianDay(jd) {
|
|
1889
|
-
let d = jd - $
|
|
1890
|
-
let m = d * $
|
|
1907
|
+
let d = jd - $7e9e96397d8405f3$var$HEBREW_EPOCH;
|
|
1908
|
+
let m = d * $7e9e96397d8405f3$var$DAY_PARTS / $7e9e96397d8405f3$var$MONTH_PARTS; // Months (approx)
|
|
1891
1909
|
let year = Math.floor((19 * m + 234) / 235) + 1; // Years (approx)
|
|
1892
|
-
let ys = $
|
|
1910
|
+
let ys = $7e9e96397d8405f3$var$startOfYear(year); // 1st day of year
|
|
1893
1911
|
let dayOfYear = Math.floor(d - ys);
|
|
1894
1912
|
// Because of the postponement rules, it's possible to guess wrong. Fix it.
|
|
1895
1913
|
while(dayOfYear < 1){
|
|
1896
1914
|
year--;
|
|
1897
|
-
ys = $
|
|
1915
|
+
ys = $7e9e96397d8405f3$var$startOfYear(year);
|
|
1898
1916
|
dayOfYear = Math.floor(d - ys);
|
|
1899
1917
|
}
|
|
1900
1918
|
// Now figure out which month we're in, and the date within that month
|
|
1901
1919
|
let month = 1;
|
|
1902
1920
|
let monthStart = 0;
|
|
1903
1921
|
while(monthStart < dayOfYear){
|
|
1904
|
-
monthStart += $
|
|
1922
|
+
monthStart += $7e9e96397d8405f3$var$getDaysInMonth(year, month);
|
|
1905
1923
|
month++;
|
|
1906
1924
|
}
|
|
1907
1925
|
month--;
|
|
1908
|
-
monthStart -= $
|
|
1926
|
+
monthStart -= $7e9e96397d8405f3$var$getDaysInMonth(year, month);
|
|
1909
1927
|
let day = dayOfYear - monthStart;
|
|
1910
|
-
return new $
|
|
1928
|
+
return new $e2d97aa3b7775168$export$99faa760c7908e4f(this, year, month, day);
|
|
1911
1929
|
}
|
|
1912
1930
|
toJulianDay(date) {
|
|
1913
|
-
let jd = $
|
|
1914
|
-
for(let month = 1; month < date.month; month++)jd += $
|
|
1915
|
-
return jd + date.day + $
|
|
1931
|
+
let jd = $7e9e96397d8405f3$var$startOfYear(date.year);
|
|
1932
|
+
for(let month = 1; month < date.month; month++)jd += $7e9e96397d8405f3$var$getDaysInMonth(date.year, month);
|
|
1933
|
+
return jd + date.day + $7e9e96397d8405f3$var$HEBREW_EPOCH;
|
|
1916
1934
|
}
|
|
1917
1935
|
getDaysInMonth(date) {
|
|
1918
|
-
return $
|
|
1936
|
+
return $7e9e96397d8405f3$var$getDaysInMonth(date.year, date.month);
|
|
1919
1937
|
}
|
|
1920
1938
|
getMonthsInYear(date) {
|
|
1921
|
-
return $
|
|
1939
|
+
return $7e9e96397d8405f3$var$isLeapYear(date.year) ? 13 : 12;
|
|
1922
1940
|
}
|
|
1923
1941
|
getDaysInYear(date) {
|
|
1924
|
-
return $
|
|
1942
|
+
return $7e9e96397d8405f3$var$getDaysInYear(date.year);
|
|
1925
1943
|
}
|
|
1926
1944
|
getYearsInEra() {
|
|
1927
1945
|
return 9999;
|
|
@@ -1934,8 +1952,8 @@ class $33f6c3bb549d8eee$export$ca405048b8fb5af {
|
|
|
1934
1952
|
balanceYearMonth(date, previousDate) {
|
|
1935
1953
|
// Keep date in the same month when switching between leap years and non leap years
|
|
1936
1954
|
if (previousDate.year !== date.year) {
|
|
1937
|
-
if ($
|
|
1938
|
-
else if (!$
|
|
1955
|
+
if ($7e9e96397d8405f3$var$isLeapYear(previousDate.year) && !$7e9e96397d8405f3$var$isLeapYear(date.year) && previousDate.month > 6) date.month--;
|
|
1956
|
+
else if (!$7e9e96397d8405f3$var$isLeapYear(previousDate.year) && $7e9e96397d8405f3$var$isLeapYear(date.year) && previousDate.month > 6) date.month++;
|
|
1939
1957
|
}
|
|
1940
1958
|
}
|
|
1941
1959
|
constructor(){
|
|
@@ -1945,12 +1963,12 @@ class $33f6c3bb549d8eee$export$ca405048b8fb5af {
|
|
|
1945
1963
|
|
|
1946
1964
|
|
|
1947
1965
|
|
|
1948
|
-
const $
|
|
1949
|
-
const $
|
|
1966
|
+
const $241b3c900de4f5b3$var$ETHIOPIC_EPOCH = 1723856;
|
|
1967
|
+
const $241b3c900de4f5b3$var$COPTIC_EPOCH = 1824665;
|
|
1950
1968
|
// The delta between Amete Alem 1 and Amete Mihret 1
|
|
1951
1969
|
// AA 5501 = AM 1
|
|
1952
|
-
const $
|
|
1953
|
-
function $
|
|
1970
|
+
const $241b3c900de4f5b3$var$AMETE_MIHRET_DELTA = 5500;
|
|
1971
|
+
function $241b3c900de4f5b3$var$ceToJulianDay(epoch, year, month, day) {
|
|
1954
1972
|
return epoch // difference from Julian epoch to 1,1,1
|
|
1955
1973
|
+ 365 * year // number of days from years
|
|
1956
1974
|
+ Math.floor(year / 4) // extra day of leap year
|
|
@@ -1958,16 +1976,16 @@ function $0e96efac8f672b88$var$ceToJulianDay(epoch, year, month, day) {
|
|
|
1958
1976
|
+ day - 1 // number of days for present month (1 based)
|
|
1959
1977
|
;
|
|
1960
1978
|
}
|
|
1961
|
-
function $
|
|
1979
|
+
function $241b3c900de4f5b3$var$julianDayToCE(calendar, epoch, jd) {
|
|
1962
1980
|
let year = Math.floor(4 * (jd - epoch) / 1461);
|
|
1963
|
-
let month = 1 + Math.floor((jd - $
|
|
1964
|
-
let day = jd + 1 - $
|
|
1965
|
-
return new $
|
|
1981
|
+
let month = 1 + Math.floor((jd - $241b3c900de4f5b3$var$ceToJulianDay(epoch, year, 1, 1)) / 30);
|
|
1982
|
+
let day = jd + 1 - $241b3c900de4f5b3$var$ceToJulianDay(epoch, year, month, 1);
|
|
1983
|
+
return new $e2d97aa3b7775168$export$99faa760c7908e4f(calendar, year, month, day);
|
|
1966
1984
|
}
|
|
1967
|
-
function $
|
|
1985
|
+
function $241b3c900de4f5b3$var$getLeapDay(year) {
|
|
1968
1986
|
return Math.floor(year % 4 / 3);
|
|
1969
1987
|
}
|
|
1970
|
-
function $
|
|
1988
|
+
function $241b3c900de4f5b3$var$getDaysInMonth(year, month) {
|
|
1971
1989
|
// The Ethiopian and Coptic calendars have 13 months, 12 of 30 days each and
|
|
1972
1990
|
// an intercalary month at the end of the year of 5 or 6 days, depending whether
|
|
1973
1991
|
// the year is a leap year or not. The Leap Year follows the same rules as the
|
|
@@ -1976,33 +1994,33 @@ function $0e96efac8f672b88$var$getDaysInMonth(year, month) {
|
|
|
1976
1994
|
if (month % 13 !== 0) // not intercalary month
|
|
1977
1995
|
return 30;
|
|
1978
1996
|
else // intercalary month 5 days + possible leap day
|
|
1979
|
-
return $
|
|
1997
|
+
return $241b3c900de4f5b3$var$getLeapDay(year) + 5;
|
|
1980
1998
|
}
|
|
1981
|
-
class $
|
|
1999
|
+
class $241b3c900de4f5b3$export$26ba6eab5e20cd7d {
|
|
1982
2000
|
fromJulianDay(jd) {
|
|
1983
|
-
let date = $
|
|
2001
|
+
let date = $241b3c900de4f5b3$var$julianDayToCE(this, $241b3c900de4f5b3$var$ETHIOPIC_EPOCH, jd);
|
|
1984
2002
|
if (date.year > 0) date.era = 'AM';
|
|
1985
2003
|
else {
|
|
1986
2004
|
date.era = 'AA';
|
|
1987
|
-
date.year += $
|
|
2005
|
+
date.year += $241b3c900de4f5b3$var$AMETE_MIHRET_DELTA;
|
|
1988
2006
|
}
|
|
1989
2007
|
return date;
|
|
1990
2008
|
}
|
|
1991
2009
|
toJulianDay(date) {
|
|
1992
2010
|
let year = date.year;
|
|
1993
|
-
if (date.era === 'AA') year -= $
|
|
1994
|
-
return $
|
|
2011
|
+
if (date.era === 'AA') year -= $241b3c900de4f5b3$var$AMETE_MIHRET_DELTA;
|
|
2012
|
+
return $241b3c900de4f5b3$var$ceToJulianDay($241b3c900de4f5b3$var$ETHIOPIC_EPOCH, year, date.month, date.day);
|
|
1995
2013
|
}
|
|
1996
2014
|
getDaysInMonth(date) {
|
|
1997
2015
|
let year = date.year;
|
|
1998
|
-
if (date.era === 'AA') year -= $
|
|
1999
|
-
return $
|
|
2016
|
+
if (date.era === 'AA') year -= $241b3c900de4f5b3$var$AMETE_MIHRET_DELTA;
|
|
2017
|
+
return $241b3c900de4f5b3$var$getDaysInMonth(year, date.month);
|
|
2000
2018
|
}
|
|
2001
2019
|
getMonthsInYear() {
|
|
2002
2020
|
return 13;
|
|
2003
2021
|
}
|
|
2004
2022
|
getDaysInYear(date) {
|
|
2005
|
-
return 365 + $
|
|
2023
|
+
return 365 + $241b3c900de4f5b3$var$getLeapDay(date.year);
|
|
2006
2024
|
}
|
|
2007
2025
|
getYearsInEra() {
|
|
2008
2026
|
return 9999;
|
|
@@ -2017,11 +2035,11 @@ class $0e96efac8f672b88$export$26ba6eab5e20cd7d {
|
|
|
2017
2035
|
this.identifier = 'ethiopic';
|
|
2018
2036
|
}
|
|
2019
2037
|
}
|
|
2020
|
-
class $
|
|
2038
|
+
class $241b3c900de4f5b3$export$d72e0c37005a4914 extends $241b3c900de4f5b3$export$26ba6eab5e20cd7d {
|
|
2021
2039
|
fromJulianDay(jd) {
|
|
2022
|
-
let date = $
|
|
2040
|
+
let date = $241b3c900de4f5b3$var$julianDayToCE(this, $241b3c900de4f5b3$var$ETHIOPIC_EPOCH, jd);
|
|
2023
2041
|
date.era = 'AA';
|
|
2024
|
-
date.year += $
|
|
2042
|
+
date.year += $241b3c900de4f5b3$var$AMETE_MIHRET_DELTA;
|
|
2025
2043
|
return date;
|
|
2026
2044
|
}
|
|
2027
2045
|
getEras() {
|
|
@@ -2035,9 +2053,9 @@ class $0e96efac8f672b88$export$d72e0c37005a4914 extends $0e96efac8f672b88$export
|
|
|
2035
2053
|
= 'ethioaa';
|
|
2036
2054
|
}
|
|
2037
2055
|
}
|
|
2038
|
-
class $
|
|
2056
|
+
class $241b3c900de4f5b3$export$fe6243cbe1a4b7c1 extends $241b3c900de4f5b3$export$26ba6eab5e20cd7d {
|
|
2039
2057
|
fromJulianDay(jd) {
|
|
2040
|
-
let date = $
|
|
2058
|
+
let date = $241b3c900de4f5b3$var$julianDayToCE(this, $241b3c900de4f5b3$var$COPTIC_EPOCH, jd);
|
|
2041
2059
|
if (date.year <= 0) {
|
|
2042
2060
|
date.era = 'BCE';
|
|
2043
2061
|
date.year = 1 - date.year;
|
|
@@ -2047,12 +2065,12 @@ class $0e96efac8f672b88$export$fe6243cbe1a4b7c1 extends $0e96efac8f672b88$export
|
|
|
2047
2065
|
toJulianDay(date) {
|
|
2048
2066
|
let year = date.year;
|
|
2049
2067
|
if (date.era === 'BCE') year = 1 - year;
|
|
2050
|
-
return $
|
|
2068
|
+
return $241b3c900de4f5b3$var$ceToJulianDay($241b3c900de4f5b3$var$COPTIC_EPOCH, year, date.month, date.day);
|
|
2051
2069
|
}
|
|
2052
2070
|
getDaysInMonth(date) {
|
|
2053
2071
|
let year = date.year;
|
|
2054
2072
|
if (date.era === 'BCE') year = 1 - year;
|
|
2055
|
-
return $
|
|
2073
|
+
return $241b3c900de4f5b3$var$getDaysInMonth(year, date.month);
|
|
2056
2074
|
}
|
|
2057
2075
|
getYearsToAdd(date, years) {
|
|
2058
2076
|
return date.era === 'BCE' ? -years : years;
|
|
@@ -2079,48 +2097,48 @@ class $0e96efac8f672b88$export$fe6243cbe1a4b7c1 extends $0e96efac8f672b88$export
|
|
|
2079
2097
|
|
|
2080
2098
|
|
|
2081
2099
|
|
|
2082
|
-
function $
|
|
2100
|
+
function $0e6dd8ee1e86aa7f$export$dd0bbc9b26defe37(name) {
|
|
2083
2101
|
switch(name){
|
|
2084
2102
|
case 'buddhist':
|
|
2085
|
-
return new $
|
|
2103
|
+
return new $3d8b8d698eadd9f9$export$42d20a78301dee44();
|
|
2086
2104
|
case 'ethiopic':
|
|
2087
|
-
return new $
|
|
2105
|
+
return new $241b3c900de4f5b3$export$26ba6eab5e20cd7d();
|
|
2088
2106
|
case 'ethioaa':
|
|
2089
|
-
return new $
|
|
2107
|
+
return new $241b3c900de4f5b3$export$d72e0c37005a4914();
|
|
2090
2108
|
case 'coptic':
|
|
2091
|
-
return new $
|
|
2109
|
+
return new $241b3c900de4f5b3$export$fe6243cbe1a4b7c1();
|
|
2092
2110
|
case 'hebrew':
|
|
2093
|
-
return new $
|
|
2111
|
+
return new $7e9e96397d8405f3$export$ca405048b8fb5af();
|
|
2094
2112
|
case 'indian':
|
|
2095
|
-
return new $
|
|
2113
|
+
return new $8626c25ab1e2c78a$export$39f31c639fa15726();
|
|
2096
2114
|
case 'islamic-civil':
|
|
2097
|
-
return new $
|
|
2115
|
+
return new $4f37d2a9fc47c3f0$export$2066795aadd37bfc();
|
|
2098
2116
|
case 'islamic-tbla':
|
|
2099
|
-
return new $
|
|
2117
|
+
return new $4f37d2a9fc47c3f0$export$37f0887f2f9d22f7();
|
|
2100
2118
|
case 'islamic-umalqura':
|
|
2101
|
-
return new $
|
|
2119
|
+
return new $4f37d2a9fc47c3f0$export$5baab4758c231076();
|
|
2102
2120
|
case 'japanese':
|
|
2103
|
-
return new $
|
|
2121
|
+
return new $a829bc7a11c5e72b$export$b746ab2b60cdffbf();
|
|
2104
2122
|
case 'persian':
|
|
2105
|
-
return new $
|
|
2123
|
+
return new $75fdc3cae9bb671c$export$37fccdbfd14c5939();
|
|
2106
2124
|
case 'roc':
|
|
2107
|
-
return new $
|
|
2125
|
+
return new $3787fdcbabdfc7bd$export$65e01080afcb0799();
|
|
2108
2126
|
case 'gregory':
|
|
2109
2127
|
default:
|
|
2110
|
-
return new $
|
|
2128
|
+
return new $680b26d521b88d00$export$80ee6245ec4f29ec();
|
|
2111
2129
|
}
|
|
2112
2130
|
}
|
|
2113
2131
|
|
|
2114
2132
|
|
|
2115
2133
|
|
|
2116
2134
|
|
|
2117
|
-
var $
|
|
2135
|
+
var $015fddca3b784be3$exports = {};
|
|
2118
2136
|
|
|
2119
2137
|
|
|
2120
2138
|
|
|
2121
|
-
var $
|
|
2139
|
+
var $d79d27c45747ea23$exports = {};
|
|
2122
2140
|
|
|
2123
|
-
$parcel$export($
|
|
2141
|
+
$parcel$export($d79d27c45747ea23$exports, "DateFormatter", () => $d79d27c45747ea23$export$ad991b66133851cf);
|
|
2124
2142
|
/*
|
|
2125
2143
|
* Copyright 2020 Adobe. All rights reserved.
|
|
2126
2144
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -2131,13 +2149,8 @@ $parcel$export($856533592ad26e29$exports, "DateFormatter", () => $856533592ad26e
|
|
|
2131
2149
|
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
2132
2150
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
2133
2151
|
* governing permissions and limitations under the License.
|
|
2134
|
-
*/ let $
|
|
2135
|
-
class $
|
|
2136
|
-
constructor(locale, options = {
|
|
2137
|
-
}){
|
|
2138
|
-
this.formatter = $856533592ad26e29$var$getCachedDateFormatter(locale, options);
|
|
2139
|
-
this.options = options;
|
|
2140
|
-
}
|
|
2152
|
+
*/ let $d79d27c45747ea23$var$formatterCache = new Map();
|
|
2153
|
+
class $d79d27c45747ea23$export$ad991b66133851cf {
|
|
2141
2154
|
format(value) {
|
|
2142
2155
|
return this.formatter.format(value);
|
|
2143
2156
|
}
|
|
@@ -2179,13 +2192,18 @@ class $856533592ad26e29$export$ad991b66133851cf {
|
|
|
2179
2192
|
}
|
|
2180
2193
|
resolvedOptions() {
|
|
2181
2194
|
let resolvedOptions = this.formatter.resolvedOptions();
|
|
2182
|
-
if ($
|
|
2183
|
-
if (!this.resolvedHourCycle) this.resolvedHourCycle = $
|
|
2195
|
+
if ($d79d27c45747ea23$var$hasBuggyResolvedHourCycle()) {
|
|
2196
|
+
if (!this.resolvedHourCycle) this.resolvedHourCycle = $d79d27c45747ea23$var$getResolvedHourCycle(resolvedOptions.locale, this.options);
|
|
2184
2197
|
resolvedOptions.hourCycle = this.resolvedHourCycle;
|
|
2185
2198
|
resolvedOptions.hour12 = this.resolvedHourCycle === 'h11' || this.resolvedHourCycle === 'h12';
|
|
2186
2199
|
}
|
|
2187
2200
|
return resolvedOptions;
|
|
2188
2201
|
}
|
|
2202
|
+
constructor(locale, options = {
|
|
2203
|
+
}){
|
|
2204
|
+
this.formatter = $d79d27c45747ea23$var$getCachedDateFormatter(locale, options);
|
|
2205
|
+
this.options = options;
|
|
2206
|
+
}
|
|
2189
2207
|
}
|
|
2190
2208
|
// There are multiple bugs involving the hour12 and hourCycle options in various browser engines.
|
|
2191
2209
|
// - Chrome [1] (and the ECMA 402 spec [2]) resolve hour12: false in English and other locales to h24 (24:00 - 23:59)
|
|
@@ -2197,7 +2215,7 @@ class $856533592ad26e29$export$ad991b66133851cf {
|
|
|
2197
2215
|
// [2] https://github.com/tc39/ecma402/issues/402
|
|
2198
2216
|
// [3] https://bugs.webkit.org/show_bug.cgi?id=229313
|
|
2199
2217
|
// https://github.com/unicode-org/cldr/blob/018b55eff7ceb389c7e3fc44e2f657eae3b10b38/common/supplemental/supplementalData.xml#L4774-L4802
|
|
2200
|
-
const $
|
|
2218
|
+
const $d79d27c45747ea23$var$hour12Preferences = {
|
|
2201
2219
|
true: {
|
|
2202
2220
|
// Only Japanese uses the h11 style for 12 hour time. All others use h12.
|
|
2203
2221
|
ja: 'h11'
|
|
@@ -2205,49 +2223,49 @@ const $856533592ad26e29$var$hour12Preferences = {
|
|
|
2205
2223
|
false: {
|
|
2206
2224
|
}
|
|
2207
2225
|
};
|
|
2208
|
-
function $
|
|
2226
|
+
function $d79d27c45747ea23$var$getCachedDateFormatter(locale, options = {
|
|
2209
2227
|
}) {
|
|
2210
2228
|
// Work around buggy hour12 behavior in Chrome / ECMA 402 spec by using hourCycle instead.
|
|
2211
2229
|
// Only apply the workaround if the issue is detected, because the hourCycle option is buggy in Safari.
|
|
2212
|
-
if (typeof options.hour12 === 'boolean' && $
|
|
2230
|
+
if (typeof options.hour12 === 'boolean' && $d79d27c45747ea23$var$hasBuggyHour12Behavior()) {
|
|
2213
2231
|
options = {
|
|
2214
2232
|
...options
|
|
2215
2233
|
};
|
|
2216
|
-
let pref = $
|
|
2234
|
+
let pref = $d79d27c45747ea23$var$hour12Preferences[String(options.hour12)][locale.split('-')[0]];
|
|
2217
2235
|
let defaultHourCycle = options.hour12 ? 'h12' : 'h23';
|
|
2218
|
-
options.hourCycle = pref
|
|
2236
|
+
options.hourCycle = pref !== null && pref !== void 0 ? pref : defaultHourCycle;
|
|
2219
2237
|
delete options.hour12;
|
|
2220
2238
|
}
|
|
2221
2239
|
let cacheKey = locale + (options ? Object.entries(options).sort((a, b)=>a[0] < b[0] ? -1 : 1
|
|
2222
2240
|
).join() : '');
|
|
2223
|
-
if ($
|
|
2241
|
+
if ($d79d27c45747ea23$var$formatterCache.has(cacheKey)) return $d79d27c45747ea23$var$formatterCache.get(cacheKey);
|
|
2224
2242
|
let numberFormatter = new Intl.DateTimeFormat(locale, options);
|
|
2225
|
-
$
|
|
2243
|
+
$d79d27c45747ea23$var$formatterCache.set(cacheKey, numberFormatter);
|
|
2226
2244
|
return numberFormatter;
|
|
2227
2245
|
}
|
|
2228
|
-
let $
|
|
2229
|
-
function $
|
|
2230
|
-
if ($
|
|
2246
|
+
let $d79d27c45747ea23$var$_hasBuggyHour12Behavior = null;
|
|
2247
|
+
function $d79d27c45747ea23$var$hasBuggyHour12Behavior() {
|
|
2248
|
+
if ($d79d27c45747ea23$var$_hasBuggyHour12Behavior == null) $d79d27c45747ea23$var$_hasBuggyHour12Behavior = new Intl.DateTimeFormat('en-US', {
|
|
2231
2249
|
hour: 'numeric',
|
|
2232
2250
|
hour12: false
|
|
2233
2251
|
}).format(new Date(2020, 2, 3, 0)) === '24';
|
|
2234
|
-
return $
|
|
2252
|
+
return $d79d27c45747ea23$var$_hasBuggyHour12Behavior;
|
|
2235
2253
|
}
|
|
2236
|
-
let $
|
|
2237
|
-
function $
|
|
2238
|
-
if ($
|
|
2254
|
+
let $d79d27c45747ea23$var$_hasBuggyResolvedHourCycle = null;
|
|
2255
|
+
function $d79d27c45747ea23$var$hasBuggyResolvedHourCycle() {
|
|
2256
|
+
if ($d79d27c45747ea23$var$_hasBuggyResolvedHourCycle == null) $d79d27c45747ea23$var$_hasBuggyResolvedHourCycle = new Intl.DateTimeFormat('fr', {
|
|
2239
2257
|
hour: 'numeric',
|
|
2240
2258
|
hour12: false
|
|
2241
2259
|
}).resolvedOptions().hourCycle === 'h12';
|
|
2242
|
-
return $
|
|
2260
|
+
return $d79d27c45747ea23$var$_hasBuggyResolvedHourCycle;
|
|
2243
2261
|
}
|
|
2244
|
-
function $
|
|
2262
|
+
function $d79d27c45747ea23$var$getResolvedHourCycle(locale, options) {
|
|
2245
2263
|
if (!options.timeStyle && !options.hour) return undefined;
|
|
2246
2264
|
// Work around buggy results in resolved hourCycle and hour12 options in WebKit.
|
|
2247
2265
|
// Format the minimum possible hour and maximum possible hour in a day and parse the results.
|
|
2248
2266
|
locale = locale.replace(/(-u-)?-nu-[a-zA-Z0-9]+/, '');
|
|
2249
2267
|
locale += (locale.includes('-u-') ? '' : '-u') + '-nu-latn';
|
|
2250
|
-
let formatter = $
|
|
2268
|
+
let formatter = $d79d27c45747ea23$var$getCachedDateFormatter(locale, {
|
|
2251
2269
|
...options,
|
|
2252
2270
|
timeZone: undefined // use local timezone
|
|
2253
2271
|
});
|
|
@@ -2263,12 +2281,12 @@ function $856533592ad26e29$var$getResolvedHourCycle(locale, options) {
|
|
|
2263
2281
|
}
|
|
2264
2282
|
|
|
2265
2283
|
|
|
2266
|
-
$parcel$exportWildcard(module.exports, $
|
|
2267
|
-
$parcel$exportWildcard(module.exports, $
|
|
2268
|
-
$parcel$exportWildcard(module.exports, $
|
|
2269
|
-
$parcel$exportWildcard(module.exports, $
|
|
2270
|
-
$parcel$exportWildcard(module.exports, $
|
|
2271
|
-
$parcel$exportWildcard(module.exports, $
|
|
2284
|
+
$parcel$exportWildcard(module.exports, $e2d97aa3b7775168$exports);
|
|
2285
|
+
$parcel$exportWildcard(module.exports, $6de69c682dff3674$exports);
|
|
2286
|
+
$parcel$exportWildcard(module.exports, $8180638d62fba910$exports);
|
|
2287
|
+
$parcel$exportWildcard(module.exports, $015fddca3b784be3$exports);
|
|
2288
|
+
$parcel$exportWildcard(module.exports, $6f8483c3b5544266$exports);
|
|
2289
|
+
$parcel$exportWildcard(module.exports, $d79d27c45747ea23$exports);
|
|
2272
2290
|
|
|
2273
2291
|
|
|
2274
2292
|
//# sourceMappingURL=main.js.map
|