@internationalized/date 3.5.3-nightly.4552 → 3.5.3-nightly.4558
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BuddhistCalendar.main.js +54 -0
- package/dist/BuddhistCalendar.main.js.map +1 -0
- package/dist/BuddhistCalendar.mjs +49 -0
- package/dist/BuddhistCalendar.module.js +49 -0
- package/dist/BuddhistCalendar.module.js.map +1 -0
- package/dist/CalendarDate.main.js +260 -0
- package/dist/CalendarDate.main.js.map +1 -0
- package/dist/CalendarDate.mjs +252 -0
- package/dist/CalendarDate.module.js +252 -0
- package/dist/CalendarDate.module.js.map +1 -0
- package/dist/DateFormatter.main.js +145 -0
- package/dist/DateFormatter.main.js.map +1 -0
- package/dist/DateFormatter.mjs +140 -0
- package/dist/DateFormatter.module.js +140 -0
- package/dist/DateFormatter.module.js.map +1 -0
- package/dist/EthiopicCalendar.main.js +170 -0
- package/dist/EthiopicCalendar.main.js.map +1 -0
- package/dist/EthiopicCalendar.mjs +163 -0
- package/dist/EthiopicCalendar.module.js +163 -0
- package/dist/EthiopicCalendar.module.js.map +1 -0
- package/dist/GregorianCalendar.main.js +143 -0
- package/dist/GregorianCalendar.main.js.map +1 -0
- package/dist/GregorianCalendar.mjs +134 -0
- package/dist/GregorianCalendar.module.js +134 -0
- package/dist/GregorianCalendar.module.js.map +1 -0
- package/dist/HebrewCalendar.main.js +149 -0
- package/dist/HebrewCalendar.main.js.map +1 -0
- package/dist/HebrewCalendar.mjs +144 -0
- package/dist/HebrewCalendar.module.js +144 -0
- package/dist/HebrewCalendar.module.js.map +1 -0
- package/dist/IndianCalendar.main.js +107 -0
- package/dist/IndianCalendar.main.js.map +1 -0
- package/dist/IndianCalendar.mjs +102 -0
- package/dist/IndianCalendar.module.js +102 -0
- package/dist/IndianCalendar.module.js.map +1 -0
- package/dist/IslamicCalendar.main.js +164 -0
- package/dist/IslamicCalendar.main.js.map +1 -0
- package/dist/IslamicCalendar.mjs +157 -0
- package/dist/IslamicCalendar.module.js +157 -0
- package/dist/IslamicCalendar.module.js.map +1 -0
- package/dist/JapaneseCalendar.main.js +180 -0
- package/dist/JapaneseCalendar.main.js.map +1 -0
- package/dist/JapaneseCalendar.mjs +175 -0
- package/dist/JapaneseCalendar.module.js +175 -0
- package/dist/JapaneseCalendar.module.js.map +1 -0
- package/dist/PersianCalendar.main.js +81 -0
- package/dist/PersianCalendar.main.js.map +1 -0
- package/dist/PersianCalendar.mjs +76 -0
- package/dist/PersianCalendar.module.js +76 -0
- package/dist/PersianCalendar.module.js.map +1 -0
- package/dist/TaiwanCalendar.main.js +81 -0
- package/dist/TaiwanCalendar.main.js.map +1 -0
- package/dist/TaiwanCalendar.mjs +76 -0
- package/dist/TaiwanCalendar.module.js +76 -0
- package/dist/TaiwanCalendar.module.js.map +1 -0
- package/dist/conversion.main.js +236 -0
- package/dist/conversion.main.js.map +1 -0
- package/dist/conversion.mjs +218 -0
- package/dist/conversion.module.js +218 -0
- package/dist/conversion.module.js.map +1 -0
- package/dist/createCalendar.main.js +69 -0
- package/dist/createCalendar.main.js.map +1 -0
- package/dist/createCalendar.mjs +64 -0
- package/dist/createCalendar.module.js +64 -0
- package/dist/createCalendar.module.js.map +1 -0
- package/dist/import.mjs +15 -2534
- package/dist/main.js +75 -2594
- package/dist/main.js.map +1 -1
- package/dist/manipulation.main.js +362 -0
- package/dist/manipulation.main.js.map +1 -0
- package/dist/manipulation.mjs +344 -0
- package/dist/manipulation.module.js +344 -0
- package/dist/manipulation.module.js.map +1 -0
- package/dist/module.js +15 -2534
- package/dist/module.js.map +1 -1
- package/dist/queries.main.js +287 -0
- package/dist/queries.main.js.map +1 -0
- package/dist/queries.mjs +256 -0
- package/dist/queries.module.js +256 -0
- package/dist/queries.module.js.map +1 -0
- package/dist/string.main.js +171 -0
- package/dist/string.main.js.map +1 -0
- package/dist/string.mjs +156 -0
- package/dist/string.module.js +156 -0
- package/dist/string.module.js.map +1 -0
- package/dist/utils.main.js +33 -0
- package/dist/utils.main.js.map +1 -0
- package/dist/utils.mjs +28 -0
- package/dist/utils.module.js +28 -0
- package/dist/utils.module.js.map +1 -0
- package/dist/weekStartData.main.js +118 -0
- package/dist/weekStartData.main.js.map +1 -0
- package/dist/weekStartData.mjs +113 -0
- package/dist/weekStartData.module.js +113 -0
- package/dist/weekStartData.module.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var $625ad1e1f4c43bc1$exports = require("./CalendarDate.main.js");
|
|
2
|
+
var $af14c9812fdceb33$exports = require("./GregorianCalendar.main.js");
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
function $parcel$export(e, n, v, s) {
|
|
6
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
$parcel$export(module.exports, "BuddhistCalendar", () => $561c4ef058278b74$export$42d20a78301dee44);
|
|
10
|
+
/*
|
|
11
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
12
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
13
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
14
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
*
|
|
16
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
17
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
18
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
19
|
+
* governing permissions and limitations under the License.
|
|
20
|
+
*/ // Portions of the code in this file are based on code from ICU.
|
|
21
|
+
// Original licensing can be found in the NOTICE file in the root directory of this source tree.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
const $561c4ef058278b74$var$BUDDHIST_ERA_START = -543;
|
|
25
|
+
class $561c4ef058278b74$export$42d20a78301dee44 extends (0, $af14c9812fdceb33$exports.GregorianCalendar) {
|
|
26
|
+
fromJulianDay(jd) {
|
|
27
|
+
let gregorianDate = super.fromJulianDay(jd);
|
|
28
|
+
let year = (0, $af14c9812fdceb33$exports.getExtendedYear)(gregorianDate.era, gregorianDate.year);
|
|
29
|
+
return new (0, $625ad1e1f4c43bc1$exports.CalendarDate)(this, year - $561c4ef058278b74$var$BUDDHIST_ERA_START, gregorianDate.month, gregorianDate.day);
|
|
30
|
+
}
|
|
31
|
+
toJulianDay(date) {
|
|
32
|
+
return super.toJulianDay($561c4ef058278b74$var$toGregorian(date));
|
|
33
|
+
}
|
|
34
|
+
getEras() {
|
|
35
|
+
return [
|
|
36
|
+
"BE"
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
getDaysInMonth(date) {
|
|
40
|
+
return super.getDaysInMonth($561c4ef058278b74$var$toGregorian(date));
|
|
41
|
+
}
|
|
42
|
+
balanceDate() {}
|
|
43
|
+
constructor(...args){
|
|
44
|
+
super(...args);
|
|
45
|
+
this.identifier = "buddhist";
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function $561c4ef058278b74$var$toGregorian(date) {
|
|
49
|
+
let [era, year] = (0, $af14c9812fdceb33$exports.fromExtendedYear)(date.year + $561c4ef058278b74$var$BUDDHIST_ERA_START);
|
|
50
|
+
return new (0, $625ad1e1f4c43bc1$exports.CalendarDate)(era, year, date.month, date.day);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=BuddhistCalendar.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,gEAAgE;AAChE,gGAAgG;;;AAMhG,MAAM,2CAAqB;AAOpB,MAAM,kDAAyB,CAAA,GAAA,2CAAgB;IAGpD,cAAc,EAAU,EAAgB;QACtC,IAAI,gBAAgB,KAAK,CAAC,cAAc;QACxC,IAAI,OAAO,CAAA,GAAA,yCAAc,EAAE,cAAc,GAAG,EAAE,cAAc,IAAI;QAChE,OAAO,IAAI,CAAA,GAAA,sCAAW,EACpB,IAAI,EACJ,OAAO,0CACP,cAAc,KAAK,EACnB,cAAc,GAAG;IAErB;IAEA,YAAY,IAAqB,EAAE;QACjC,OAAO,KAAK,CAAC,YAAY,kCAAY;IACvC;IAEA,UAAU;QACR,OAAO;YAAC;SAAK;IACf;IAEA,eAAe,IAAqB,EAAU;QAC5C,OAAO,KAAK,CAAC,eAAe,kCAAY;IAC1C;IAEA,cAAc,CAAC;;;aAzBf,aAAa;;AA0Bf;AAEA,SAAS,kCAAY,IAAqB;IACxC,IAAI,CAAC,KAAK,KAAK,GAAG,CAAA,GAAA,0CAAe,EAAE,KAAK,IAAI,GAAG;IAC/C,OAAO,IAAI,CAAA,GAAA,sCAAW,EACpB,KACA,MACA,KAAK,KAAK,EACV,KAAK,GAAG;AAEZ","sources":["packages/@internationalized/date/src/calendars/BuddhistCalendar.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from ICU.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\n\nimport {AnyCalendarDate} from '../types';\nimport {CalendarDate} from '../CalendarDate';\nimport {fromExtendedYear, getExtendedYear, GregorianCalendar} from './GregorianCalendar';\n\nconst BUDDHIST_ERA_START = -543;\n\n/**\n * The Buddhist calendar is the same as the Gregorian calendar, but counts years\n * starting from the birth of Buddha in 543 BC (Gregorian). It supports only one\n * era, identified as 'BE'.\n */\nexport class BuddhistCalendar extends GregorianCalendar {\n identifier = 'buddhist';\n\n fromJulianDay(jd: number): CalendarDate {\n let gregorianDate = super.fromJulianDay(jd);\n let year = getExtendedYear(gregorianDate.era, gregorianDate.year);\n return new CalendarDate(\n this,\n year - BUDDHIST_ERA_START,\n gregorianDate.month,\n gregorianDate.day\n );\n }\n\n toJulianDay(date: AnyCalendarDate) {\n return super.toJulianDay(toGregorian(date));\n }\n\n getEras() {\n return ['BE'];\n }\n\n getDaysInMonth(date: AnyCalendarDate): number {\n return super.getDaysInMonth(toGregorian(date));\n }\n\n balanceDate() {}\n}\n\nfunction toGregorian(date: AnyCalendarDate) {\n let [era, year] = fromExtendedYear(date.year + BUDDHIST_ERA_START);\n return new CalendarDate(\n era,\n year,\n date.month,\n date.day\n );\n}\n"],"names":[],"version":3,"file":"BuddhistCalendar.main.js.map"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f} from "./CalendarDate.mjs";
|
|
2
|
+
import {fromExtendedYear as $3b62074eb05584b2$export$4475b7e617eb123c, getExtendedYear as $3b62074eb05584b2$export$c36e0ecb2d4fa69d, GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec} from "./GregorianCalendar.mjs";
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
6
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
+
* governing permissions and limitations under the License.
|
|
14
|
+
*/ // Portions of the code in this file are based on code from ICU.
|
|
15
|
+
// Original licensing can be found in the NOTICE file in the root directory of this source tree.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
const $8d73d47422ca7302$var$BUDDHIST_ERA_START = -543;
|
|
19
|
+
class $8d73d47422ca7302$export$42d20a78301dee44 extends (0, $3b62074eb05584b2$export$80ee6245ec4f29ec) {
|
|
20
|
+
fromJulianDay(jd) {
|
|
21
|
+
let gregorianDate = super.fromJulianDay(jd);
|
|
22
|
+
let year = (0, $3b62074eb05584b2$export$c36e0ecb2d4fa69d)(gregorianDate.era, gregorianDate.year);
|
|
23
|
+
return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(this, year - $8d73d47422ca7302$var$BUDDHIST_ERA_START, gregorianDate.month, gregorianDate.day);
|
|
24
|
+
}
|
|
25
|
+
toJulianDay(date) {
|
|
26
|
+
return super.toJulianDay($8d73d47422ca7302$var$toGregorian(date));
|
|
27
|
+
}
|
|
28
|
+
getEras() {
|
|
29
|
+
return [
|
|
30
|
+
"BE"
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
getDaysInMonth(date) {
|
|
34
|
+
return super.getDaysInMonth($8d73d47422ca7302$var$toGregorian(date));
|
|
35
|
+
}
|
|
36
|
+
balanceDate() {}
|
|
37
|
+
constructor(...args){
|
|
38
|
+
super(...args);
|
|
39
|
+
this.identifier = "buddhist";
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function $8d73d47422ca7302$var$toGregorian(date) {
|
|
43
|
+
let [era, year] = (0, $3b62074eb05584b2$export$4475b7e617eb123c)(date.year + $8d73d47422ca7302$var$BUDDHIST_ERA_START);
|
|
44
|
+
return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(era, year, date.month, date.day);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
export {$8d73d47422ca7302$export$42d20a78301dee44 as BuddhistCalendar};
|
|
49
|
+
//# sourceMappingURL=BuddhistCalendar.mjs.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f} from "./CalendarDate.module.js";
|
|
2
|
+
import {fromExtendedYear as $3b62074eb05584b2$export$4475b7e617eb123c, getExtendedYear as $3b62074eb05584b2$export$c36e0ecb2d4fa69d, GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec} from "./GregorianCalendar.module.js";
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
6
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
+
* governing permissions and limitations under the License.
|
|
14
|
+
*/ // Portions of the code in this file are based on code from ICU.
|
|
15
|
+
// Original licensing can be found in the NOTICE file in the root directory of this source tree.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
const $8d73d47422ca7302$var$BUDDHIST_ERA_START = -543;
|
|
19
|
+
class $8d73d47422ca7302$export$42d20a78301dee44 extends (0, $3b62074eb05584b2$export$80ee6245ec4f29ec) {
|
|
20
|
+
fromJulianDay(jd) {
|
|
21
|
+
let gregorianDate = super.fromJulianDay(jd);
|
|
22
|
+
let year = (0, $3b62074eb05584b2$export$c36e0ecb2d4fa69d)(gregorianDate.era, gregorianDate.year);
|
|
23
|
+
return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(this, year - $8d73d47422ca7302$var$BUDDHIST_ERA_START, gregorianDate.month, gregorianDate.day);
|
|
24
|
+
}
|
|
25
|
+
toJulianDay(date) {
|
|
26
|
+
return super.toJulianDay($8d73d47422ca7302$var$toGregorian(date));
|
|
27
|
+
}
|
|
28
|
+
getEras() {
|
|
29
|
+
return [
|
|
30
|
+
"BE"
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
getDaysInMonth(date) {
|
|
34
|
+
return super.getDaysInMonth($8d73d47422ca7302$var$toGregorian(date));
|
|
35
|
+
}
|
|
36
|
+
balanceDate() {}
|
|
37
|
+
constructor(...args){
|
|
38
|
+
super(...args);
|
|
39
|
+
this.identifier = "buddhist";
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function $8d73d47422ca7302$var$toGregorian(date) {
|
|
43
|
+
let [era, year] = (0, $3b62074eb05584b2$export$4475b7e617eb123c)(date.year + $8d73d47422ca7302$var$BUDDHIST_ERA_START);
|
|
44
|
+
return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(era, year, date.month, date.day);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
export {$8d73d47422ca7302$export$42d20a78301dee44 as BuddhistCalendar};
|
|
49
|
+
//# sourceMappingURL=BuddhistCalendar.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;AAAA;;;;;;;;;;CAUC,GAED,gEAAgE;AAChE,gGAAgG;;;AAMhG,MAAM,2CAAqB;AAOpB,MAAM,kDAAyB,CAAA,GAAA,yCAAgB;IAGpD,cAAc,EAAU,EAAgB;QACtC,IAAI,gBAAgB,KAAK,CAAC,cAAc;QACxC,IAAI,OAAO,CAAA,GAAA,yCAAc,EAAE,cAAc,GAAG,EAAE,cAAc,IAAI;QAChE,OAAO,IAAI,CAAA,GAAA,yCAAW,EACpB,IAAI,EACJ,OAAO,0CACP,cAAc,KAAK,EACnB,cAAc,GAAG;IAErB;IAEA,YAAY,IAAqB,EAAE;QACjC,OAAO,KAAK,CAAC,YAAY,kCAAY;IACvC;IAEA,UAAU;QACR,OAAO;YAAC;SAAK;IACf;IAEA,eAAe,IAAqB,EAAU;QAC5C,OAAO,KAAK,CAAC,eAAe,kCAAY;IAC1C;IAEA,cAAc,CAAC;;;aAzBf,aAAa;;AA0Bf;AAEA,SAAS,kCAAY,IAAqB;IACxC,IAAI,CAAC,KAAK,KAAK,GAAG,CAAA,GAAA,yCAAe,EAAE,KAAK,IAAI,GAAG;IAC/C,OAAO,IAAI,CAAA,GAAA,yCAAW,EACpB,KACA,MACA,KAAK,KAAK,EACV,KAAK,GAAG;AAEZ","sources":["packages/@internationalized/date/src/calendars/BuddhistCalendar.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from ICU.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\n\nimport {AnyCalendarDate} from '../types';\nimport {CalendarDate} from '../CalendarDate';\nimport {fromExtendedYear, getExtendedYear, GregorianCalendar} from './GregorianCalendar';\n\nconst BUDDHIST_ERA_START = -543;\n\n/**\n * The Buddhist calendar is the same as the Gregorian calendar, but counts years\n * starting from the birth of Buddha in 543 BC (Gregorian). It supports only one\n * era, identified as 'BE'.\n */\nexport class BuddhistCalendar extends GregorianCalendar {\n identifier = 'buddhist';\n\n fromJulianDay(jd: number): CalendarDate {\n let gregorianDate = super.fromJulianDay(jd);\n let year = getExtendedYear(gregorianDate.era, gregorianDate.year);\n return new CalendarDate(\n this,\n year - BUDDHIST_ERA_START,\n gregorianDate.month,\n gregorianDate.day\n );\n }\n\n toJulianDay(date: AnyCalendarDate) {\n return super.toJulianDay(toGregorian(date));\n }\n\n getEras() {\n return ['BE'];\n }\n\n getDaysInMonth(date: AnyCalendarDate): number {\n return super.getDaysInMonth(toGregorian(date));\n }\n\n balanceDate() {}\n}\n\nfunction toGregorian(date: AnyCalendarDate) {\n let [era, year] = fromExtendedYear(date.year + BUDDHIST_ERA_START);\n return new CalendarDate(\n era,\n year,\n date.month,\n date.day\n );\n}\n"],"names":[],"version":3,"file":"BuddhistCalendar.module.js.map"}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
var $5c0571aa5b6fb5da$exports = require("./manipulation.main.js");
|
|
2
|
+
var $1f0f7ebf1ae6c530$exports = require("./queries.main.js");
|
|
3
|
+
var $4c32e2d98e5a5134$exports = require("./string.main.js");
|
|
4
|
+
var $af14c9812fdceb33$exports = require("./GregorianCalendar.main.js");
|
|
5
|
+
var $4ae0260a69729f1d$exports = require("./conversion.main.js");
|
|
6
|
+
var $lislG$swchelperscjs_class_private_field_initcjs = require("@swc/helpers/cjs/_class_private_field_init.cjs");
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function $parcel$export(e, n, v, s) {
|
|
10
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
$parcel$export(module.exports, "CalendarDate", () => $625ad1e1f4c43bc1$export$99faa760c7908e4f);
|
|
14
|
+
$parcel$export(module.exports, "Time", () => $625ad1e1f4c43bc1$export$680ea196effce5f);
|
|
15
|
+
$parcel$export(module.exports, "CalendarDateTime", () => $625ad1e1f4c43bc1$export$ca871e8dbb80966f);
|
|
16
|
+
$parcel$export(module.exports, "ZonedDateTime", () => $625ad1e1f4c43bc1$export$d3b7288e7994edea);
|
|
17
|
+
/*
|
|
18
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
19
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
20
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
21
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
+
*
|
|
23
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
24
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
25
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
26
|
+
* governing permissions and limitations under the License.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
function $625ad1e1f4c43bc1$var$shiftArgs(args) {
|
|
34
|
+
let calendar = typeof args[0] === "object" ? args.shift() : new (0, $af14c9812fdceb33$exports.GregorianCalendar)();
|
|
35
|
+
let era;
|
|
36
|
+
if (typeof args[0] === "string") era = args.shift();
|
|
37
|
+
else {
|
|
38
|
+
let eras = calendar.getEras();
|
|
39
|
+
era = eras[eras.length - 1];
|
|
40
|
+
}
|
|
41
|
+
let year = args.shift();
|
|
42
|
+
let month = args.shift();
|
|
43
|
+
let day = args.shift();
|
|
44
|
+
return [
|
|
45
|
+
calendar,
|
|
46
|
+
era,
|
|
47
|
+
year,
|
|
48
|
+
month,
|
|
49
|
+
day
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
var // This prevents TypeScript from allowing other types with the same fields to match.
|
|
53
|
+
// i.e. a ZonedDateTime should not be be passable to a parameter that expects CalendarDate.
|
|
54
|
+
// If that behavior is desired, use the AnyCalendarDate interface instead.
|
|
55
|
+
// @ts-ignore
|
|
56
|
+
$625ad1e1f4c43bc1$var$_type = /*#__PURE__*/ new WeakMap();
|
|
57
|
+
class $625ad1e1f4c43bc1$export$99faa760c7908e4f {
|
|
58
|
+
/** Returns a copy of this date. */ copy() {
|
|
59
|
+
if (this.era) return new $625ad1e1f4c43bc1$export$99faa760c7908e4f(this.calendar, this.era, this.year, this.month, this.day);
|
|
60
|
+
else return new $625ad1e1f4c43bc1$export$99faa760c7908e4f(this.calendar, this.year, this.month, this.day);
|
|
61
|
+
}
|
|
62
|
+
/** Returns a new `CalendarDate` with the given duration added to it. */ add(duration) {
|
|
63
|
+
return (0, $5c0571aa5b6fb5da$exports.add)(this, duration);
|
|
64
|
+
}
|
|
65
|
+
/** Returns a new `CalendarDate` with the given duration subtracted from it. */ subtract(duration) {
|
|
66
|
+
return (0, $5c0571aa5b6fb5da$exports.subtract)(this, duration);
|
|
67
|
+
}
|
|
68
|
+
/** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
|
|
69
|
+
return (0, $5c0571aa5b6fb5da$exports.set)(this, fields);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Returns a new `CalendarDate` with the given field adjusted by a specified amount.
|
|
73
|
+
* When the resulting value reaches the limits of the field, it wraps around.
|
|
74
|
+
*/ cycle(field, amount, options) {
|
|
75
|
+
return (0, $5c0571aa5b6fb5da$exports.cycleDate)(this, field, amount, options);
|
|
76
|
+
}
|
|
77
|
+
/** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */ toDate(timeZone) {
|
|
78
|
+
return (0, $4ae0260a69729f1d$exports.toDate)(this, timeZone);
|
|
79
|
+
}
|
|
80
|
+
/** Converts the date to an ISO 8601 formatted string. */ toString() {
|
|
81
|
+
return (0, $4c32e2d98e5a5134$exports.dateToString)(this);
|
|
82
|
+
}
|
|
83
|
+
/** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {
|
|
84
|
+
return (0, $1f0f7ebf1ae6c530$exports.compareDate)(this, b);
|
|
85
|
+
}
|
|
86
|
+
constructor(...args){
|
|
87
|
+
(0, $lislG$swchelperscjs_class_private_field_initcjs._)(this, $625ad1e1f4c43bc1$var$_type, {
|
|
88
|
+
writable: true,
|
|
89
|
+
value: void 0
|
|
90
|
+
});
|
|
91
|
+
let [calendar, era, year, month, day] = $625ad1e1f4c43bc1$var$shiftArgs(args);
|
|
92
|
+
this.calendar = calendar;
|
|
93
|
+
this.era = era;
|
|
94
|
+
this.year = year;
|
|
95
|
+
this.month = month;
|
|
96
|
+
this.day = day;
|
|
97
|
+
(0, $5c0571aa5b6fb5da$exports.constrain)(this);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
var // This prevents TypeScript from allowing other types with the same fields to match.
|
|
101
|
+
// @ts-ignore
|
|
102
|
+
$625ad1e1f4c43bc1$var$_type1 = /*#__PURE__*/ new WeakMap();
|
|
103
|
+
class $625ad1e1f4c43bc1$export$680ea196effce5f {
|
|
104
|
+
/** Returns a copy of this time. */ copy() {
|
|
105
|
+
return new $625ad1e1f4c43bc1$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond);
|
|
106
|
+
}
|
|
107
|
+
/** Returns a new `Time` with the given duration added to it. */ add(duration) {
|
|
108
|
+
return (0, $5c0571aa5b6fb5da$exports.addTime)(this, duration);
|
|
109
|
+
}
|
|
110
|
+
/** Returns a new `Time` with the given duration subtracted from it. */ subtract(duration) {
|
|
111
|
+
return (0, $5c0571aa5b6fb5da$exports.subtractTime)(this, duration);
|
|
112
|
+
}
|
|
113
|
+
/** Returns a new `Time` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
|
|
114
|
+
return (0, $5c0571aa5b6fb5da$exports.setTime)(this, fields);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Returns a new `Time` with the given field adjusted by a specified amount.
|
|
118
|
+
* When the resulting value reaches the limits of the field, it wraps around.
|
|
119
|
+
*/ cycle(field, amount, options) {
|
|
120
|
+
return (0, $5c0571aa5b6fb5da$exports.cycleTime)(this, field, amount, options);
|
|
121
|
+
}
|
|
122
|
+
/** Converts the time to an ISO 8601 formatted string. */ toString() {
|
|
123
|
+
return (0, $4c32e2d98e5a5134$exports.timeToString)(this);
|
|
124
|
+
}
|
|
125
|
+
/** Compares this time with another. A negative result indicates that this time is before the given one, and a positive time indicates that it is after. */ compare(b) {
|
|
126
|
+
return (0, $1f0f7ebf1ae6c530$exports.compareTime)(this, b);
|
|
127
|
+
}
|
|
128
|
+
constructor(hour = 0, minute = 0, second = 0, millisecond = 0){
|
|
129
|
+
(0, $lislG$swchelperscjs_class_private_field_initcjs._)(this, $625ad1e1f4c43bc1$var$_type1, {
|
|
130
|
+
writable: true,
|
|
131
|
+
value: void 0
|
|
132
|
+
});
|
|
133
|
+
this.hour = hour;
|
|
134
|
+
this.minute = minute;
|
|
135
|
+
this.second = second;
|
|
136
|
+
this.millisecond = millisecond;
|
|
137
|
+
(0, $5c0571aa5b6fb5da$exports.constrainTime)(this);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
var // This prevents TypeScript from allowing other types with the same fields to match.
|
|
141
|
+
// @ts-ignore
|
|
142
|
+
$625ad1e1f4c43bc1$var$_type2 = /*#__PURE__*/ new WeakMap();
|
|
143
|
+
class $625ad1e1f4c43bc1$export$ca871e8dbb80966f {
|
|
144
|
+
/** Returns a copy of this date. */ copy() {
|
|
145
|
+
if (this.era) return new $625ad1e1f4c43bc1$export$ca871e8dbb80966f(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
|
|
146
|
+
else return new $625ad1e1f4c43bc1$export$ca871e8dbb80966f(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
|
|
147
|
+
}
|
|
148
|
+
/** Returns a new `CalendarDateTime` with the given duration added to it. */ add(duration) {
|
|
149
|
+
return (0, $5c0571aa5b6fb5da$exports.add)(this, duration);
|
|
150
|
+
}
|
|
151
|
+
/** Returns a new `CalendarDateTime` with the given duration subtracted from it. */ subtract(duration) {
|
|
152
|
+
return (0, $5c0571aa5b6fb5da$exports.subtract)(this, duration);
|
|
153
|
+
}
|
|
154
|
+
/** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
|
|
155
|
+
return (0, $5c0571aa5b6fb5da$exports.set)((0, $5c0571aa5b6fb5da$exports.setTime)(this, fields), fields);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
|
|
159
|
+
* When the resulting value reaches the limits of the field, it wraps around.
|
|
160
|
+
*/ cycle(field, amount, options) {
|
|
161
|
+
switch(field){
|
|
162
|
+
case "era":
|
|
163
|
+
case "year":
|
|
164
|
+
case "month":
|
|
165
|
+
case "day":
|
|
166
|
+
return (0, $5c0571aa5b6fb5da$exports.cycleDate)(this, field, amount, options);
|
|
167
|
+
default:
|
|
168
|
+
return (0, $5c0571aa5b6fb5da$exports.cycleTime)(this, field, amount, options);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/** Converts the date to a native JavaScript Date object in the given time zone. */ toDate(timeZone, disambiguation) {
|
|
172
|
+
return (0, $4ae0260a69729f1d$exports.toDate)(this, timeZone, disambiguation);
|
|
173
|
+
}
|
|
174
|
+
/** Converts the date to an ISO 8601 formatted string. */ toString() {
|
|
175
|
+
return (0, $4c32e2d98e5a5134$exports.dateTimeToString)(this);
|
|
176
|
+
}
|
|
177
|
+
/** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {
|
|
178
|
+
let res = (0, $1f0f7ebf1ae6c530$exports.compareDate)(this, b);
|
|
179
|
+
if (res === 0) return (0, $1f0f7ebf1ae6c530$exports.compareTime)(this, (0, $4ae0260a69729f1d$exports.toCalendarDateTime)(b));
|
|
180
|
+
return res;
|
|
181
|
+
}
|
|
182
|
+
constructor(...args){
|
|
183
|
+
(0, $lislG$swchelperscjs_class_private_field_initcjs._)(this, $625ad1e1f4c43bc1$var$_type2, {
|
|
184
|
+
writable: true,
|
|
185
|
+
value: void 0
|
|
186
|
+
});
|
|
187
|
+
let [calendar, era, year, month, day] = $625ad1e1f4c43bc1$var$shiftArgs(args);
|
|
188
|
+
this.calendar = calendar;
|
|
189
|
+
this.era = era;
|
|
190
|
+
this.year = year;
|
|
191
|
+
this.month = month;
|
|
192
|
+
this.day = day;
|
|
193
|
+
this.hour = args.shift() || 0;
|
|
194
|
+
this.minute = args.shift() || 0;
|
|
195
|
+
this.second = args.shift() || 0;
|
|
196
|
+
this.millisecond = args.shift() || 0;
|
|
197
|
+
(0, $5c0571aa5b6fb5da$exports.constrain)(this);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
var // This prevents TypeScript from allowing other types with the same fields to match.
|
|
201
|
+
// @ts-ignore
|
|
202
|
+
$625ad1e1f4c43bc1$var$_type3 = /*#__PURE__*/ new WeakMap();
|
|
203
|
+
class $625ad1e1f4c43bc1$export$d3b7288e7994edea {
|
|
204
|
+
/** Returns a copy of this date. */ copy() {
|
|
205
|
+
if (this.era) return new $625ad1e1f4c43bc1$export$d3b7288e7994edea(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
|
|
206
|
+
else return new $625ad1e1f4c43bc1$export$d3b7288e7994edea(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
|
|
207
|
+
}
|
|
208
|
+
/** Returns a new `ZonedDateTime` with the given duration added to it. */ add(duration) {
|
|
209
|
+
return (0, $5c0571aa5b6fb5da$exports.addZoned)(this, duration);
|
|
210
|
+
}
|
|
211
|
+
/** Returns a new `ZonedDateTime` with the given duration subtracted from it. */ subtract(duration) {
|
|
212
|
+
return (0, $5c0571aa5b6fb5da$exports.subtractZoned)(this, duration);
|
|
213
|
+
}
|
|
214
|
+
/** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields, disambiguation) {
|
|
215
|
+
return (0, $5c0571aa5b6fb5da$exports.setZoned)(this, fields, disambiguation);
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Returns a new `ZonedDateTime` with the given field adjusted by a specified amount.
|
|
219
|
+
* When the resulting value reaches the limits of the field, it wraps around.
|
|
220
|
+
*/ cycle(field, amount, options) {
|
|
221
|
+
return (0, $5c0571aa5b6fb5da$exports.cycleZoned)(this, field, amount, options);
|
|
222
|
+
}
|
|
223
|
+
/** Converts the date to a native JavaScript Date object. */ toDate() {
|
|
224
|
+
return (0, $4ae0260a69729f1d$exports.zonedToDate)(this);
|
|
225
|
+
}
|
|
226
|
+
/** Converts the date to an ISO 8601 formatted string, including the UTC offset and time zone identifier. */ toString() {
|
|
227
|
+
return (0, $4c32e2d98e5a5134$exports.zonedDateTimeToString)(this);
|
|
228
|
+
}
|
|
229
|
+
/** Converts the date to an ISO 8601 formatted string in UTC. */ toAbsoluteString() {
|
|
230
|
+
return this.toDate().toISOString();
|
|
231
|
+
}
|
|
232
|
+
/** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {
|
|
233
|
+
// TODO: Is this a bad idea??
|
|
234
|
+
return this.toDate().getTime() - (0, $4ae0260a69729f1d$exports.toZoned)(b, this.timeZone).toDate().getTime();
|
|
235
|
+
}
|
|
236
|
+
constructor(...args){
|
|
237
|
+
(0, $lislG$swchelperscjs_class_private_field_initcjs._)(this, $625ad1e1f4c43bc1$var$_type3, {
|
|
238
|
+
writable: true,
|
|
239
|
+
value: void 0
|
|
240
|
+
});
|
|
241
|
+
let [calendar, era, year, month, day] = $625ad1e1f4c43bc1$var$shiftArgs(args);
|
|
242
|
+
let timeZone = args.shift();
|
|
243
|
+
let offset = args.shift();
|
|
244
|
+
this.calendar = calendar;
|
|
245
|
+
this.era = era;
|
|
246
|
+
this.year = year;
|
|
247
|
+
this.month = month;
|
|
248
|
+
this.day = day;
|
|
249
|
+
this.timeZone = timeZone;
|
|
250
|
+
this.offset = offset;
|
|
251
|
+
this.hour = args.shift() || 0;
|
|
252
|
+
this.minute = args.shift() || 0;
|
|
253
|
+
this.second = args.shift() || 0;
|
|
254
|
+
this.millisecond = args.shift() || 0;
|
|
255
|
+
(0, $5c0571aa5b6fb5da$exports.constrain)(this);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
//# sourceMappingURL=CalendarDate.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AASD,SAAS,gCAAU,IAAW;IAC5B,IAAI,WAAqB,OAAO,IAAI,CAAC,EAAE,KAAK,WACxC,KAAK,KAAK,KACV,IA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IAAI;IACnC;IAEC,8DAA8D,GAC/D,mBAAmB;QACjB,OAAO,IAAI,CAAC,MAAM,GAAG,WAAW;IAClC;IAEA,yJAAyJ,GACzJ,QAAQ,CAAkD,EAAE;QAC1D,6BAA6B;QAC7B,OAAO,IAAI,CAAC,MAAM,GAAG,OAAO,KAAK,CAAA,GAAA,iCAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAC7E;IAtEA,YAAY,GAAG,IAAW,CAAE;QAhC5B,8DAAA;;mBAAA,KAAA;;QAiCE,IAAI,CAAC,UAAU,KAAK,MAAM,OAAO,IAAI,GAAG,gCAAU;QAClD,IAAI,WAAW,KAAK,KAAK;QACzB,IAAI,SAAS,KAAK,KAAK;QACvB,IAAI,CAAC,QAAQ,GAAG;QAChB,IAAI,CAAC,GAAG,GAAG;QACX,IAAI,CAAC,IAAI,GAAG;QACZ,IAAI,CAAC,KAAK,GAAG;QACb,IAAI,CAAC,GAAG,GAAG;QACX,IAAI,CAAC,QAAQ,GAAG;QAChB,IAAI,CAAC,MAAM,GAAG;QACd,IAAI,CAAC,IAAI,GAAG,KAAK,KAAK,MAAM;QAC5B,IAAI,CAAC,MAAM,GAAG,KAAK,KAAK,MAAM;QAC9B,IAAI,CAAC,MAAM,GAAG,KAAK,KAAK,MAAM;QAC9B,IAAI,CAAC,WAAW,GAAG,KAAK,KAAK,MAAM;QAEnC,CAAA,GAAA,mCAAQ,EAAE,IAAI;IAChB;AAsDF","sources":["packages/@internationalized/date/src/CalendarDate.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {add, addTime, addZoned, constrain, constrainTime, cycleDate, cycleTime, cycleZoned, set, setTime, setZoned, subtract, subtractTime, subtractZoned} from './manipulation';\nimport {AnyCalendarDate, AnyTime, Calendar, CycleOptions, CycleTimeOptions, DateDuration, DateField, DateFields, DateTimeDuration, Disambiguation, TimeDuration, TimeField, TimeFields} from './types';\nimport {compareDate, compareTime} from './queries';\nimport {dateTimeToString, dateToString, timeToString, zonedDateTimeToString} from './string';\nimport {GregorianCalendar} from './calendars/GregorianCalendar';\nimport {toCalendarDateTime, toDate, toZoned, zonedToDate} from './conversion';\n\nfunction shiftArgs(args: any[]) {\n let calendar: Calendar = typeof args[0] === 'object'\n ? args.shift()\n : new GregorianCalendar();\n\n let era: string;\n if (typeof args[0] === 'string') {\n era = args.shift();\n } else {\n let eras = calendar.getEras();\n era = eras[eras.length - 1];\n }\n\n let year = args.shift();\n let month = args.shift();\n let day = args.shift();\n\n return [calendar, era, year, month, day];\n}\n\n/** A CalendarDate represents a date without any time components in a specific calendar system. */\nexport class CalendarDate {\n // This prevents TypeScript from allowing other types with the same fields to match.\n // i.e. a ZonedDateTime should not be be passable to a parameter that expects CalendarDate.\n // If that behavior is desired, use the AnyCalendarDate interface instead.\n // @ts-ignore\n #type;\n /** The calendar system associated with this date, e.g. Gregorian. */\n public readonly calendar: Calendar;\n /** The calendar era for this date, e.g. \"BC\" or \"AD\". */\n public readonly era: string;\n /** The year of this date within the era. */\n public readonly year: number;\n /**\n * The month number within the year. Note that some calendar systems such as Hebrew\n * may have a variable number of months per year. Therefore, month numbers may not\n * always correspond to the same month names in different years.\n */\n public readonly month: number;\n /** The day number within the month. */\n public readonly day: number;\n\n constructor(year: number, month: number, day: number);\n constructor(era: string, year: number, month: number, day: number);\n constructor(calendar: Calendar, year: number, month: number, day: number);\n constructor(calendar: Calendar, era: string, year: number, month: number, day: number);\n constructor(...args: any[]) {\n let [calendar, era, year, month, day] = shiftArgs(args);\n this.calendar = calendar;\n this.era = era;\n this.year = year;\n this.month = month;\n this.day = day;\n\n constrain(this);\n }\n\n /** Returns a copy of this date. */\n copy(): CalendarDate {\n if (this.era) {\n return new CalendarDate(this.calendar, this.era, this.year, this.month, this.day);\n } else {\n return new CalendarDate(this.calendar, this.year, this.month, this.day);\n }\n }\n\n /** Returns a new `CalendarDate` with the given duration added to it. */\n add(duration: DateDuration): CalendarDate {\n return add(this, duration);\n }\n\n /** Returns a new `CalendarDate` with the given duration subtracted from it. */\n subtract(duration: DateDuration): CalendarDate {\n return subtract(this, duration);\n }\n\n /** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */\n set(fields: DateFields): CalendarDate {\n return set(this, fields);\n }\n\n /**\n * Returns a new `CalendarDate` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */\n cycle(field: DateField, amount: number, options?: CycleOptions): CalendarDate {\n return cycleDate(this, field, amount, options);\n }\n\n /** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */\n toDate(timeZone: string): Date {\n return toDate(this, timeZone);\n }\n\n /** Converts the date to an ISO 8601 formatted string. */\n toString(): string {\n return dateToString(this);\n }\n\n /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */\n compare(b: AnyCalendarDate): number {\n return compareDate(this, b);\n }\n}\n\n/** A Time represents a clock time without any date components. */\nexport class Time {\n // This prevents TypeScript from allowing other types with the same fields to match.\n // @ts-ignore\n #type;\n /** The hour, numbered from 0 to 23. */\n public readonly hour: number;\n /** The minute in the hour. */\n public readonly minute: number;\n /** The second in the minute. */\n public readonly second: number;\n /** The millisecond in the second. */\n public readonly millisecond: number;\n\n constructor(\n hour: number = 0,\n minute: number = 0,\n second: number = 0,\n millisecond: number = 0\n ) {\n this.hour = hour;\n this.minute = minute;\n this.second = second;\n this.millisecond = millisecond;\n constrainTime(this);\n }\n\n /** Returns a copy of this time. */\n copy(): Time {\n return new Time(this.hour, this.minute, this.second, this.millisecond);\n }\n\n /** Returns a new `Time` with the given duration added to it. */\n add(duration: TimeDuration) {\n return addTime(this, duration);\n }\n\n /** Returns a new `Time` with the given duration subtracted from it. */\n subtract(duration: TimeDuration) {\n return subtractTime(this, duration);\n }\n\n /** Returns a new `Time` with the given fields set to the provided values. Other fields will be constrained accordingly. */\n set(fields: TimeFields) {\n return setTime(this, fields);\n }\n\n /**\n * Returns a new `Time` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */\n cycle(field: TimeField, amount: number, options?: CycleTimeOptions) {\n return cycleTime(this, field, amount, options);\n }\n\n /** Converts the time to an ISO 8601 formatted string. */\n toString() {\n return timeToString(this);\n }\n\n /** Compares this time with another. A negative result indicates that this time is before the given one, and a positive time indicates that it is after. */\n compare(b: AnyTime) {\n return compareTime(this, b);\n }\n}\n\n/** A CalendarDateTime represents a date and time without a time zone, in a specific calendar system. */\nexport class CalendarDateTime {\n // This prevents TypeScript from allowing other types with the same fields to match.\n // @ts-ignore\n #type;\n /** The calendar system associated with this date, e.g. Gregorian. */\n public readonly calendar: Calendar;\n /** The calendar era for this date, e.g. \"BC\" or \"AD\". */\n public readonly era: string;\n /** The year of this date within the era. */\n public readonly year: number;\n /**\n * The month number within the year. Note that some calendar systems such as Hebrew\n * may have a variable number of months per year. Therefore, month numbers may not\n * always correspond to the same month names in different years.\n */\n public readonly month: number;\n /** The day number within the month. */\n public readonly day: number;\n /** The hour in the day, numbered from 0 to 23. */\n public readonly hour: number;\n /** The minute in the hour. */\n public readonly minute: number;\n /** The second in the minute. */\n public readonly second: number;\n /** The millisecond in the second. */\n public readonly millisecond: number;\n\n constructor(year: number, month: number, day: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(era: string, year: number, month: number, day: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(calendar: Calendar, year: number, month: number, day: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(calendar: Calendar, era: string, year: number, month: number, day: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(...args: any[]) {\n let [calendar, era, year, month, day] = shiftArgs(args);\n this.calendar = calendar;\n this.era = era;\n this.year = year;\n this.month = month;\n this.day = day;\n this.hour = args.shift() || 0;\n this.minute = args.shift() || 0;\n this.second = args.shift() || 0;\n this.millisecond = args.shift() || 0;\n\n constrain(this);\n }\n\n /** Returns a copy of this date. */\n copy(): CalendarDateTime {\n if (this.era) {\n return new CalendarDateTime(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);\n } else {\n return new CalendarDateTime(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);\n }\n }\n\n /** Returns a new `CalendarDateTime` with the given duration added to it. */\n add(duration: DateTimeDuration): CalendarDateTime {\n return add(this, duration);\n }\n\n /** Returns a new `CalendarDateTime` with the given duration subtracted from it. */\n subtract(duration: DateTimeDuration): CalendarDateTime {\n return subtract(this, duration);\n }\n\n /** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */\n set(fields: DateFields & TimeFields): CalendarDateTime {\n return set(setTime(this, fields), fields);\n }\n\n /**\n * Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */\n cycle(field: DateField | TimeField, amount: number, options?: CycleTimeOptions): CalendarDateTime {\n switch (field) {\n case 'era':\n case 'year':\n case 'month':\n case 'day':\n return cycleDate(this, field, amount, options);\n default:\n return cycleTime(this, field, amount, options);\n }\n }\n\n /** Converts the date to a native JavaScript Date object in the given time zone. */\n toDate(timeZone: string, disambiguation?: Disambiguation): Date {\n return toDate(this, timeZone, disambiguation);\n }\n\n /** Converts the date to an ISO 8601 formatted string. */\n toString(): string {\n return dateTimeToString(this);\n }\n\n /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */\n compare(b: CalendarDate | CalendarDateTime | ZonedDateTime): number {\n let res = compareDate(this, b);\n if (res === 0) {\n return compareTime(this, toCalendarDateTime(b));\n }\n\n return res;\n }\n}\n\n/** A ZonedDateTime represents a date and time in a specific time zone and calendar system. */\nexport class ZonedDateTime {\n // This prevents TypeScript from allowing other types with the same fields to match.\n // @ts-ignore\n #type;\n /** The calendar system associated with this date, e.g. Gregorian. */\n public readonly calendar: Calendar;\n /** The calendar era for this date, e.g. \"BC\" or \"AD\". */\n public readonly era: string;\n /** The year of this date within the era. */\n public readonly year: number;\n /**\n * The month number within the year. Note that some calendar systems such as Hebrew\n * may have a variable number of months per year. Therefore, month numbers may not\n * always correspond to the same month names in different years.\n */\n public readonly month: number;\n /** The day number within the month. */\n public readonly day: number;\n /** The hour in the day, numbered from 0 to 23. */\n public readonly hour: number;\n /** The minute in the hour. */\n public readonly minute: number;\n /** The second in the minute. */\n public readonly second: number;\n /** The millisecond in the second. */\n public readonly millisecond: number;\n /** The IANA time zone identifier that this date and time is represented in. */\n public readonly timeZone: string;\n /** The UTC offset for this time, in milliseconds. */\n public readonly offset: number;\n\n constructor(year: number, month: number, day: number, timeZone: string, offset: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(era: string, year: number, month: number, day: number, timeZone: string, offset: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(calendar: Calendar, year: number, month: number, day: number, timeZone: string, offset: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(calendar: Calendar, era: string, year: number, month: number, day: number, timeZone: string, offset: number, hour?: number, minute?: number, second?: number, millisecond?: number);\n constructor(...args: any[]) {\n let [calendar, era, year, month, day] = shiftArgs(args);\n let timeZone = args.shift();\n let offset = args.shift();\n this.calendar = calendar;\n this.era = era;\n this.year = year;\n this.month = month;\n this.day = day;\n this.timeZone = timeZone;\n this.offset = offset;\n this.hour = args.shift() || 0;\n this.minute = args.shift() || 0;\n this.second = args.shift() || 0;\n this.millisecond = args.shift() || 0;\n\n constrain(this);\n }\n\n /** Returns a copy of this date. */\n copy(): ZonedDateTime {\n if (this.era) {\n return new ZonedDateTime(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);\n } else {\n return new ZonedDateTime(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);\n }\n }\n\n /** Returns a new `ZonedDateTime` with the given duration added to it. */\n add(duration: DateTimeDuration) {\n return addZoned(this, duration);\n }\n\n /** Returns a new `ZonedDateTime` with the given duration subtracted from it. */\n subtract(duration: DateTimeDuration) {\n return subtractZoned(this, duration);\n }\n\n /** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */\n set(fields: DateFields & TimeFields, disambiguation?: Disambiguation) {\n return setZoned(this, fields, disambiguation);\n }\n\n /**\n * Returns a new `ZonedDateTime` with the given field adjusted by a specified amount.\n * When the resulting value reaches the limits of the field, it wraps around.\n */\n cycle(field: DateField | TimeField, amount: number, options?: CycleTimeOptions) {\n return cycleZoned(this, field, amount, options);\n }\n\n /** Converts the date to a native JavaScript Date object. */\n toDate() {\n return zonedToDate(this);\n }\n\n /** Converts the date to an ISO 8601 formatted string, including the UTC offset and time zone identifier. */\n toString() {\n return zonedDateTimeToString(this);\n }\n\n /** Converts the date to an ISO 8601 formatted string in UTC. */\n toAbsoluteString() {\n return this.toDate().toISOString();\n }\n\n /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */\n compare(b: CalendarDate | CalendarDateTime | ZonedDateTime) {\n // TODO: Is this a bad idea??\n return this.toDate().getTime() - toZoned(b, this.timeZone).toDate().getTime();\n }\n}\n"],"names":[],"version":3,"file":"CalendarDate.main.js.map"}
|