@internationalized/date 3.5.3-nightly.4555 → 3.5.3-nightly.4560

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.
Files changed (96) hide show
  1. package/dist/BuddhistCalendar.main.js +54 -0
  2. package/dist/BuddhistCalendar.main.js.map +1 -0
  3. package/dist/BuddhistCalendar.mjs +49 -0
  4. package/dist/BuddhistCalendar.module.js +49 -0
  5. package/dist/BuddhistCalendar.module.js.map +1 -0
  6. package/dist/CalendarDate.main.js +260 -0
  7. package/dist/CalendarDate.main.js.map +1 -0
  8. package/dist/CalendarDate.mjs +252 -0
  9. package/dist/CalendarDate.module.js +252 -0
  10. package/dist/CalendarDate.module.js.map +1 -0
  11. package/dist/DateFormatter.main.js +145 -0
  12. package/dist/DateFormatter.main.js.map +1 -0
  13. package/dist/DateFormatter.mjs +140 -0
  14. package/dist/DateFormatter.module.js +140 -0
  15. package/dist/DateFormatter.module.js.map +1 -0
  16. package/dist/EthiopicCalendar.main.js +170 -0
  17. package/dist/EthiopicCalendar.main.js.map +1 -0
  18. package/dist/EthiopicCalendar.mjs +163 -0
  19. package/dist/EthiopicCalendar.module.js +163 -0
  20. package/dist/EthiopicCalendar.module.js.map +1 -0
  21. package/dist/GregorianCalendar.main.js +143 -0
  22. package/dist/GregorianCalendar.main.js.map +1 -0
  23. package/dist/GregorianCalendar.mjs +134 -0
  24. package/dist/GregorianCalendar.module.js +134 -0
  25. package/dist/GregorianCalendar.module.js.map +1 -0
  26. package/dist/HebrewCalendar.main.js +149 -0
  27. package/dist/HebrewCalendar.main.js.map +1 -0
  28. package/dist/HebrewCalendar.mjs +144 -0
  29. package/dist/HebrewCalendar.module.js +144 -0
  30. package/dist/HebrewCalendar.module.js.map +1 -0
  31. package/dist/IndianCalendar.main.js +107 -0
  32. package/dist/IndianCalendar.main.js.map +1 -0
  33. package/dist/IndianCalendar.mjs +102 -0
  34. package/dist/IndianCalendar.module.js +102 -0
  35. package/dist/IndianCalendar.module.js.map +1 -0
  36. package/dist/IslamicCalendar.main.js +164 -0
  37. package/dist/IslamicCalendar.main.js.map +1 -0
  38. package/dist/IslamicCalendar.mjs +157 -0
  39. package/dist/IslamicCalendar.module.js +157 -0
  40. package/dist/IslamicCalendar.module.js.map +1 -0
  41. package/dist/JapaneseCalendar.main.js +180 -0
  42. package/dist/JapaneseCalendar.main.js.map +1 -0
  43. package/dist/JapaneseCalendar.mjs +175 -0
  44. package/dist/JapaneseCalendar.module.js +175 -0
  45. package/dist/JapaneseCalendar.module.js.map +1 -0
  46. package/dist/PersianCalendar.main.js +81 -0
  47. package/dist/PersianCalendar.main.js.map +1 -0
  48. package/dist/PersianCalendar.mjs +76 -0
  49. package/dist/PersianCalendar.module.js +76 -0
  50. package/dist/PersianCalendar.module.js.map +1 -0
  51. package/dist/TaiwanCalendar.main.js +81 -0
  52. package/dist/TaiwanCalendar.main.js.map +1 -0
  53. package/dist/TaiwanCalendar.mjs +76 -0
  54. package/dist/TaiwanCalendar.module.js +76 -0
  55. package/dist/TaiwanCalendar.module.js.map +1 -0
  56. package/dist/conversion.main.js +236 -0
  57. package/dist/conversion.main.js.map +1 -0
  58. package/dist/conversion.mjs +218 -0
  59. package/dist/conversion.module.js +218 -0
  60. package/dist/conversion.module.js.map +1 -0
  61. package/dist/createCalendar.main.js +69 -0
  62. package/dist/createCalendar.main.js.map +1 -0
  63. package/dist/createCalendar.mjs +64 -0
  64. package/dist/createCalendar.module.js +64 -0
  65. package/dist/createCalendar.module.js.map +1 -0
  66. package/dist/import.mjs +15 -2534
  67. package/dist/main.js +75 -2594
  68. package/dist/main.js.map +1 -1
  69. package/dist/manipulation.main.js +362 -0
  70. package/dist/manipulation.main.js.map +1 -0
  71. package/dist/manipulation.mjs +344 -0
  72. package/dist/manipulation.module.js +344 -0
  73. package/dist/manipulation.module.js.map +1 -0
  74. package/dist/module.js +15 -2534
  75. package/dist/module.js.map +1 -1
  76. package/dist/queries.main.js +287 -0
  77. package/dist/queries.main.js.map +1 -0
  78. package/dist/queries.mjs +256 -0
  79. package/dist/queries.module.js +256 -0
  80. package/dist/queries.module.js.map +1 -0
  81. package/dist/string.main.js +171 -0
  82. package/dist/string.main.js.map +1 -0
  83. package/dist/string.mjs +156 -0
  84. package/dist/string.module.js +156 -0
  85. package/dist/string.module.js.map +1 -0
  86. package/dist/utils.main.js +33 -0
  87. package/dist/utils.main.js.map +1 -0
  88. package/dist/utils.mjs +28 -0
  89. package/dist/utils.module.js +28 -0
  90. package/dist/utils.module.js.map +1 -0
  91. package/dist/weekStartData.main.js +118 -0
  92. package/dist/weekStartData.main.js.map +1 -0
  93. package/dist/weekStartData.mjs +113 -0
  94. package/dist/weekStartData.module.js +113 -0
  95. package/dist/weekStartData.module.js.map +1 -0
  96. package/package.json +2 -2
@@ -0,0 +1,252 @@
1
+ import {add as $735220c2d4774dd3$export$e16d8520af44a096, addTime as $735220c2d4774dd3$export$7ed87b6bc2506470, addZoned as $735220c2d4774dd3$export$96b1d28349274637, constrain as $735220c2d4774dd3$export$c4e2ecac49351ef2, constrainTime as $735220c2d4774dd3$export$7555de1e070510cb, cycleDate as $735220c2d4774dd3$export$d52ced6badfb9a4c, cycleTime as $735220c2d4774dd3$export$dd02b3e0007dfe28, cycleZoned as $735220c2d4774dd3$export$9a297d111fc86b79, set as $735220c2d4774dd3$export$adaa4cf7ef1b65be, setTime as $735220c2d4774dd3$export$e5d5e1c1822b6e56, setZoned as $735220c2d4774dd3$export$31b5430eb18be4f8, subtract as $735220c2d4774dd3$export$4e2d2ead65e5f7e3, subtractTime as $735220c2d4774dd3$export$fe34d3a381cd7501, subtractZoned as $735220c2d4774dd3$export$6814caac34ca03c7} from "./manipulation.mjs";
2
+ import {compareDate as $14e0f24ef4ac5c92$export$68781ddf31c0090f, compareTime as $14e0f24ef4ac5c92$export$c19a80a9721b80f6} from "./queries.mjs";
3
+ import {dateTimeToString as $fae977aafc393c5c$export$4223de14708adc63, dateToString as $fae977aafc393c5c$export$60dfd74aa96791bd, timeToString as $fae977aafc393c5c$export$f59dee82248f5ad4, zonedDateTimeToString as $fae977aafc393c5c$export$bf79f1ebf4b18792} from "./string.mjs";
4
+ import {GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec} from "./GregorianCalendar.mjs";
5
+ import {toCalendarDateTime as $11d87f3f76e88657$export$b21e0b124e224484, toDate as $11d87f3f76e88657$export$e67a095c620b86fe, toZoned as $11d87f3f76e88657$export$84c95a83c799e074, zonedToDate as $11d87f3f76e88657$export$83aac07b4c37b25} from "./conversion.mjs";
6
+ import {_ as $aksy1$_} from "@swc/helpers/_/_class_private_field_init";
7
+
8
+ /*
9
+ * Copyright 2020 Adobe. All rights reserved.
10
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
11
+ * you may not use this file except in compliance with the License. You may obtain a copy
12
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software distributed under
15
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
16
+ * OF ANY KIND, either express or implied. See the License for the specific language
17
+ * governing permissions and limitations under the License.
18
+ */
19
+
20
+
21
+
22
+
23
+
24
+ function $35ea8db9cb2ccb90$var$shiftArgs(args) {
25
+ let calendar = typeof args[0] === "object" ? args.shift() : new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)();
26
+ let era;
27
+ if (typeof args[0] === "string") era = args.shift();
28
+ else {
29
+ let eras = calendar.getEras();
30
+ era = eras[eras.length - 1];
31
+ }
32
+ let year = args.shift();
33
+ let month = args.shift();
34
+ let day = args.shift();
35
+ return [
36
+ calendar,
37
+ era,
38
+ year,
39
+ month,
40
+ day
41
+ ];
42
+ }
43
+ var // This prevents TypeScript from allowing other types with the same fields to match.
44
+ // i.e. a ZonedDateTime should not be be passable to a parameter that expects CalendarDate.
45
+ // If that behavior is desired, use the AnyCalendarDate interface instead.
46
+ // @ts-ignore
47
+ $35ea8db9cb2ccb90$var$_type = /*#__PURE__*/ new WeakMap();
48
+ class $35ea8db9cb2ccb90$export$99faa760c7908e4f {
49
+ /** Returns a copy of this date. */ copy() {
50
+ if (this.era) return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(this.calendar, this.era, this.year, this.month, this.day);
51
+ else return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(this.calendar, this.year, this.month, this.day);
52
+ }
53
+ /** Returns a new `CalendarDate` with the given duration added to it. */ add(duration) {
54
+ return (0, $735220c2d4774dd3$export$e16d8520af44a096)(this, duration);
55
+ }
56
+ /** Returns a new `CalendarDate` with the given duration subtracted from it. */ subtract(duration) {
57
+ return (0, $735220c2d4774dd3$export$4e2d2ead65e5f7e3)(this, duration);
58
+ }
59
+ /** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
60
+ return (0, $735220c2d4774dd3$export$adaa4cf7ef1b65be)(this, fields);
61
+ }
62
+ /**
63
+ * Returns a new `CalendarDate` with the given field adjusted by a specified amount.
64
+ * When the resulting value reaches the limits of the field, it wraps around.
65
+ */ cycle(field, amount, options) {
66
+ return (0, $735220c2d4774dd3$export$d52ced6badfb9a4c)(this, field, amount, options);
67
+ }
68
+ /** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */ toDate(timeZone) {
69
+ return (0, $11d87f3f76e88657$export$e67a095c620b86fe)(this, timeZone);
70
+ }
71
+ /** Converts the date to an ISO 8601 formatted string. */ toString() {
72
+ return (0, $fae977aafc393c5c$export$60dfd74aa96791bd)(this);
73
+ }
74
+ /** 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) {
75
+ return (0, $14e0f24ef4ac5c92$export$68781ddf31c0090f)(this, b);
76
+ }
77
+ constructor(...args){
78
+ (0, $aksy1$_)(this, $35ea8db9cb2ccb90$var$_type, {
79
+ writable: true,
80
+ value: void 0
81
+ });
82
+ let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
83
+ this.calendar = calendar;
84
+ this.era = era;
85
+ this.year = year;
86
+ this.month = month;
87
+ this.day = day;
88
+ (0, $735220c2d4774dd3$export$c4e2ecac49351ef2)(this);
89
+ }
90
+ }
91
+ var // This prevents TypeScript from allowing other types with the same fields to match.
92
+ // @ts-ignore
93
+ $35ea8db9cb2ccb90$var$_type1 = /*#__PURE__*/ new WeakMap();
94
+ class $35ea8db9cb2ccb90$export$680ea196effce5f {
95
+ /** Returns a copy of this time. */ copy() {
96
+ return new $35ea8db9cb2ccb90$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond);
97
+ }
98
+ /** Returns a new `Time` with the given duration added to it. */ add(duration) {
99
+ return (0, $735220c2d4774dd3$export$7ed87b6bc2506470)(this, duration);
100
+ }
101
+ /** Returns a new `Time` with the given duration subtracted from it. */ subtract(duration) {
102
+ return (0, $735220c2d4774dd3$export$fe34d3a381cd7501)(this, duration);
103
+ }
104
+ /** Returns a new `Time` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
105
+ return (0, $735220c2d4774dd3$export$e5d5e1c1822b6e56)(this, fields);
106
+ }
107
+ /**
108
+ * Returns a new `Time` with the given field adjusted by a specified amount.
109
+ * When the resulting value reaches the limits of the field, it wraps around.
110
+ */ cycle(field, amount, options) {
111
+ return (0, $735220c2d4774dd3$export$dd02b3e0007dfe28)(this, field, amount, options);
112
+ }
113
+ /** Converts the time to an ISO 8601 formatted string. */ toString() {
114
+ return (0, $fae977aafc393c5c$export$f59dee82248f5ad4)(this);
115
+ }
116
+ /** 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) {
117
+ return (0, $14e0f24ef4ac5c92$export$c19a80a9721b80f6)(this, b);
118
+ }
119
+ constructor(hour = 0, minute = 0, second = 0, millisecond = 0){
120
+ (0, $aksy1$_)(this, $35ea8db9cb2ccb90$var$_type1, {
121
+ writable: true,
122
+ value: void 0
123
+ });
124
+ this.hour = hour;
125
+ this.minute = minute;
126
+ this.second = second;
127
+ this.millisecond = millisecond;
128
+ (0, $735220c2d4774dd3$export$7555de1e070510cb)(this);
129
+ }
130
+ }
131
+ var // This prevents TypeScript from allowing other types with the same fields to match.
132
+ // @ts-ignore
133
+ $35ea8db9cb2ccb90$var$_type2 = /*#__PURE__*/ new WeakMap();
134
+ class $35ea8db9cb2ccb90$export$ca871e8dbb80966f {
135
+ /** Returns a copy of this date. */ copy() {
136
+ if (this.era) return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
137
+ else return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
138
+ }
139
+ /** Returns a new `CalendarDateTime` with the given duration added to it. */ add(duration) {
140
+ return (0, $735220c2d4774dd3$export$e16d8520af44a096)(this, duration);
141
+ }
142
+ /** Returns a new `CalendarDateTime` with the given duration subtracted from it. */ subtract(duration) {
143
+ return (0, $735220c2d4774dd3$export$4e2d2ead65e5f7e3)(this, duration);
144
+ }
145
+ /** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
146
+ return (0, $735220c2d4774dd3$export$adaa4cf7ef1b65be)((0, $735220c2d4774dd3$export$e5d5e1c1822b6e56)(this, fields), fields);
147
+ }
148
+ /**
149
+ * Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
150
+ * When the resulting value reaches the limits of the field, it wraps around.
151
+ */ cycle(field, amount, options) {
152
+ switch(field){
153
+ case "era":
154
+ case "year":
155
+ case "month":
156
+ case "day":
157
+ return (0, $735220c2d4774dd3$export$d52ced6badfb9a4c)(this, field, amount, options);
158
+ default:
159
+ return (0, $735220c2d4774dd3$export$dd02b3e0007dfe28)(this, field, amount, options);
160
+ }
161
+ }
162
+ /** Converts the date to a native JavaScript Date object in the given time zone. */ toDate(timeZone, disambiguation) {
163
+ return (0, $11d87f3f76e88657$export$e67a095c620b86fe)(this, timeZone, disambiguation);
164
+ }
165
+ /** Converts the date to an ISO 8601 formatted string. */ toString() {
166
+ return (0, $fae977aafc393c5c$export$4223de14708adc63)(this);
167
+ }
168
+ /** 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) {
169
+ let res = (0, $14e0f24ef4ac5c92$export$68781ddf31c0090f)(this, b);
170
+ if (res === 0) return (0, $14e0f24ef4ac5c92$export$c19a80a9721b80f6)(this, (0, $11d87f3f76e88657$export$b21e0b124e224484)(b));
171
+ return res;
172
+ }
173
+ constructor(...args){
174
+ (0, $aksy1$_)(this, $35ea8db9cb2ccb90$var$_type2, {
175
+ writable: true,
176
+ value: void 0
177
+ });
178
+ let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
179
+ this.calendar = calendar;
180
+ this.era = era;
181
+ this.year = year;
182
+ this.month = month;
183
+ this.day = day;
184
+ this.hour = args.shift() || 0;
185
+ this.minute = args.shift() || 0;
186
+ this.second = args.shift() || 0;
187
+ this.millisecond = args.shift() || 0;
188
+ (0, $735220c2d4774dd3$export$c4e2ecac49351ef2)(this);
189
+ }
190
+ }
191
+ var // This prevents TypeScript from allowing other types with the same fields to match.
192
+ // @ts-ignore
193
+ $35ea8db9cb2ccb90$var$_type3 = /*#__PURE__*/ new WeakMap();
194
+ class $35ea8db9cb2ccb90$export$d3b7288e7994edea {
195
+ /** Returns a copy of this date. */ copy() {
196
+ if (this.era) return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
197
+ else return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
198
+ }
199
+ /** Returns a new `ZonedDateTime` with the given duration added to it. */ add(duration) {
200
+ return (0, $735220c2d4774dd3$export$96b1d28349274637)(this, duration);
201
+ }
202
+ /** Returns a new `ZonedDateTime` with the given duration subtracted from it. */ subtract(duration) {
203
+ return (0, $735220c2d4774dd3$export$6814caac34ca03c7)(this, duration);
204
+ }
205
+ /** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields, disambiguation) {
206
+ return (0, $735220c2d4774dd3$export$31b5430eb18be4f8)(this, fields, disambiguation);
207
+ }
208
+ /**
209
+ * Returns a new `ZonedDateTime` with the given field adjusted by a specified amount.
210
+ * When the resulting value reaches the limits of the field, it wraps around.
211
+ */ cycle(field, amount, options) {
212
+ return (0, $735220c2d4774dd3$export$9a297d111fc86b79)(this, field, amount, options);
213
+ }
214
+ /** Converts the date to a native JavaScript Date object. */ toDate() {
215
+ return (0, $11d87f3f76e88657$export$83aac07b4c37b25)(this);
216
+ }
217
+ /** Converts the date to an ISO 8601 formatted string, including the UTC offset and time zone identifier. */ toString() {
218
+ return (0, $fae977aafc393c5c$export$bf79f1ebf4b18792)(this);
219
+ }
220
+ /** Converts the date to an ISO 8601 formatted string in UTC. */ toAbsoluteString() {
221
+ return this.toDate().toISOString();
222
+ }
223
+ /** 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) {
224
+ // TODO: Is this a bad idea??
225
+ return this.toDate().getTime() - (0, $11d87f3f76e88657$export$84c95a83c799e074)(b, this.timeZone).toDate().getTime();
226
+ }
227
+ constructor(...args){
228
+ (0, $aksy1$_)(this, $35ea8db9cb2ccb90$var$_type3, {
229
+ writable: true,
230
+ value: void 0
231
+ });
232
+ let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
233
+ let timeZone = args.shift();
234
+ let offset = args.shift();
235
+ this.calendar = calendar;
236
+ this.era = era;
237
+ this.year = year;
238
+ this.month = month;
239
+ this.day = day;
240
+ this.timeZone = timeZone;
241
+ this.offset = offset;
242
+ this.hour = args.shift() || 0;
243
+ this.minute = args.shift() || 0;
244
+ this.second = args.shift() || 0;
245
+ this.millisecond = args.shift() || 0;
246
+ (0, $735220c2d4774dd3$export$c4e2ecac49351ef2)(this);
247
+ }
248
+ }
249
+
250
+
251
+ export {$35ea8db9cb2ccb90$export$99faa760c7908e4f as CalendarDate, $35ea8db9cb2ccb90$export$680ea196effce5f as Time, $35ea8db9cb2ccb90$export$ca871e8dbb80966f as CalendarDateTime, $35ea8db9cb2ccb90$export$d3b7288e7994edea as ZonedDateTime};
252
+ //# sourceMappingURL=CalendarDate.mjs.map
@@ -0,0 +1,252 @@
1
+ import {add as $735220c2d4774dd3$export$e16d8520af44a096, addTime as $735220c2d4774dd3$export$7ed87b6bc2506470, addZoned as $735220c2d4774dd3$export$96b1d28349274637, constrain as $735220c2d4774dd3$export$c4e2ecac49351ef2, constrainTime as $735220c2d4774dd3$export$7555de1e070510cb, cycleDate as $735220c2d4774dd3$export$d52ced6badfb9a4c, cycleTime as $735220c2d4774dd3$export$dd02b3e0007dfe28, cycleZoned as $735220c2d4774dd3$export$9a297d111fc86b79, set as $735220c2d4774dd3$export$adaa4cf7ef1b65be, setTime as $735220c2d4774dd3$export$e5d5e1c1822b6e56, setZoned as $735220c2d4774dd3$export$31b5430eb18be4f8, subtract as $735220c2d4774dd3$export$4e2d2ead65e5f7e3, subtractTime as $735220c2d4774dd3$export$fe34d3a381cd7501, subtractZoned as $735220c2d4774dd3$export$6814caac34ca03c7} from "./manipulation.module.js";
2
+ import {compareDate as $14e0f24ef4ac5c92$export$68781ddf31c0090f, compareTime as $14e0f24ef4ac5c92$export$c19a80a9721b80f6} from "./queries.module.js";
3
+ import {dateTimeToString as $fae977aafc393c5c$export$4223de14708adc63, dateToString as $fae977aafc393c5c$export$60dfd74aa96791bd, timeToString as $fae977aafc393c5c$export$f59dee82248f5ad4, zonedDateTimeToString as $fae977aafc393c5c$export$bf79f1ebf4b18792} from "./string.module.js";
4
+ import {GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec} from "./GregorianCalendar.module.js";
5
+ import {toCalendarDateTime as $11d87f3f76e88657$export$b21e0b124e224484, toDate as $11d87f3f76e88657$export$e67a095c620b86fe, toZoned as $11d87f3f76e88657$export$84c95a83c799e074, zonedToDate as $11d87f3f76e88657$export$83aac07b4c37b25} from "./conversion.module.js";
6
+ import {_ as $aksy1$_} from "@swc/helpers/_/_class_private_field_init";
7
+
8
+ /*
9
+ * Copyright 2020 Adobe. All rights reserved.
10
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
11
+ * you may not use this file except in compliance with the License. You may obtain a copy
12
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software distributed under
15
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
16
+ * OF ANY KIND, either express or implied. See the License for the specific language
17
+ * governing permissions and limitations under the License.
18
+ */
19
+
20
+
21
+
22
+
23
+
24
+ function $35ea8db9cb2ccb90$var$shiftArgs(args) {
25
+ let calendar = typeof args[0] === "object" ? args.shift() : new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)();
26
+ let era;
27
+ if (typeof args[0] === "string") era = args.shift();
28
+ else {
29
+ let eras = calendar.getEras();
30
+ era = eras[eras.length - 1];
31
+ }
32
+ let year = args.shift();
33
+ let month = args.shift();
34
+ let day = args.shift();
35
+ return [
36
+ calendar,
37
+ era,
38
+ year,
39
+ month,
40
+ day
41
+ ];
42
+ }
43
+ var // This prevents TypeScript from allowing other types with the same fields to match.
44
+ // i.e. a ZonedDateTime should not be be passable to a parameter that expects CalendarDate.
45
+ // If that behavior is desired, use the AnyCalendarDate interface instead.
46
+ // @ts-ignore
47
+ $35ea8db9cb2ccb90$var$_type = /*#__PURE__*/ new WeakMap();
48
+ class $35ea8db9cb2ccb90$export$99faa760c7908e4f {
49
+ /** Returns a copy of this date. */ copy() {
50
+ if (this.era) return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(this.calendar, this.era, this.year, this.month, this.day);
51
+ else return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(this.calendar, this.year, this.month, this.day);
52
+ }
53
+ /** Returns a new `CalendarDate` with the given duration added to it. */ add(duration) {
54
+ return (0, $735220c2d4774dd3$export$e16d8520af44a096)(this, duration);
55
+ }
56
+ /** Returns a new `CalendarDate` with the given duration subtracted from it. */ subtract(duration) {
57
+ return (0, $735220c2d4774dd3$export$4e2d2ead65e5f7e3)(this, duration);
58
+ }
59
+ /** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
60
+ return (0, $735220c2d4774dd3$export$adaa4cf7ef1b65be)(this, fields);
61
+ }
62
+ /**
63
+ * Returns a new `CalendarDate` with the given field adjusted by a specified amount.
64
+ * When the resulting value reaches the limits of the field, it wraps around.
65
+ */ cycle(field, amount, options) {
66
+ return (0, $735220c2d4774dd3$export$d52ced6badfb9a4c)(this, field, amount, options);
67
+ }
68
+ /** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */ toDate(timeZone) {
69
+ return (0, $11d87f3f76e88657$export$e67a095c620b86fe)(this, timeZone);
70
+ }
71
+ /** Converts the date to an ISO 8601 formatted string. */ toString() {
72
+ return (0, $fae977aafc393c5c$export$60dfd74aa96791bd)(this);
73
+ }
74
+ /** 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) {
75
+ return (0, $14e0f24ef4ac5c92$export$68781ddf31c0090f)(this, b);
76
+ }
77
+ constructor(...args){
78
+ (0, $aksy1$_)(this, $35ea8db9cb2ccb90$var$_type, {
79
+ writable: true,
80
+ value: void 0
81
+ });
82
+ let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
83
+ this.calendar = calendar;
84
+ this.era = era;
85
+ this.year = year;
86
+ this.month = month;
87
+ this.day = day;
88
+ (0, $735220c2d4774dd3$export$c4e2ecac49351ef2)(this);
89
+ }
90
+ }
91
+ var // This prevents TypeScript from allowing other types with the same fields to match.
92
+ // @ts-ignore
93
+ $35ea8db9cb2ccb90$var$_type1 = /*#__PURE__*/ new WeakMap();
94
+ class $35ea8db9cb2ccb90$export$680ea196effce5f {
95
+ /** Returns a copy of this time. */ copy() {
96
+ return new $35ea8db9cb2ccb90$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond);
97
+ }
98
+ /** Returns a new `Time` with the given duration added to it. */ add(duration) {
99
+ return (0, $735220c2d4774dd3$export$7ed87b6bc2506470)(this, duration);
100
+ }
101
+ /** Returns a new `Time` with the given duration subtracted from it. */ subtract(duration) {
102
+ return (0, $735220c2d4774dd3$export$fe34d3a381cd7501)(this, duration);
103
+ }
104
+ /** Returns a new `Time` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
105
+ return (0, $735220c2d4774dd3$export$e5d5e1c1822b6e56)(this, fields);
106
+ }
107
+ /**
108
+ * Returns a new `Time` with the given field adjusted by a specified amount.
109
+ * When the resulting value reaches the limits of the field, it wraps around.
110
+ */ cycle(field, amount, options) {
111
+ return (0, $735220c2d4774dd3$export$dd02b3e0007dfe28)(this, field, amount, options);
112
+ }
113
+ /** Converts the time to an ISO 8601 formatted string. */ toString() {
114
+ return (0, $fae977aafc393c5c$export$f59dee82248f5ad4)(this);
115
+ }
116
+ /** 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) {
117
+ return (0, $14e0f24ef4ac5c92$export$c19a80a9721b80f6)(this, b);
118
+ }
119
+ constructor(hour = 0, minute = 0, second = 0, millisecond = 0){
120
+ (0, $aksy1$_)(this, $35ea8db9cb2ccb90$var$_type1, {
121
+ writable: true,
122
+ value: void 0
123
+ });
124
+ this.hour = hour;
125
+ this.minute = minute;
126
+ this.second = second;
127
+ this.millisecond = millisecond;
128
+ (0, $735220c2d4774dd3$export$7555de1e070510cb)(this);
129
+ }
130
+ }
131
+ var // This prevents TypeScript from allowing other types with the same fields to match.
132
+ // @ts-ignore
133
+ $35ea8db9cb2ccb90$var$_type2 = /*#__PURE__*/ new WeakMap();
134
+ class $35ea8db9cb2ccb90$export$ca871e8dbb80966f {
135
+ /** Returns a copy of this date. */ copy() {
136
+ if (this.era) return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
137
+ else return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
138
+ }
139
+ /** Returns a new `CalendarDateTime` with the given duration added to it. */ add(duration) {
140
+ return (0, $735220c2d4774dd3$export$e16d8520af44a096)(this, duration);
141
+ }
142
+ /** Returns a new `CalendarDateTime` with the given duration subtracted from it. */ subtract(duration) {
143
+ return (0, $735220c2d4774dd3$export$4e2d2ead65e5f7e3)(this, duration);
144
+ }
145
+ /** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
146
+ return (0, $735220c2d4774dd3$export$adaa4cf7ef1b65be)((0, $735220c2d4774dd3$export$e5d5e1c1822b6e56)(this, fields), fields);
147
+ }
148
+ /**
149
+ * Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
150
+ * When the resulting value reaches the limits of the field, it wraps around.
151
+ */ cycle(field, amount, options) {
152
+ switch(field){
153
+ case "era":
154
+ case "year":
155
+ case "month":
156
+ case "day":
157
+ return (0, $735220c2d4774dd3$export$d52ced6badfb9a4c)(this, field, amount, options);
158
+ default:
159
+ return (0, $735220c2d4774dd3$export$dd02b3e0007dfe28)(this, field, amount, options);
160
+ }
161
+ }
162
+ /** Converts the date to a native JavaScript Date object in the given time zone. */ toDate(timeZone, disambiguation) {
163
+ return (0, $11d87f3f76e88657$export$e67a095c620b86fe)(this, timeZone, disambiguation);
164
+ }
165
+ /** Converts the date to an ISO 8601 formatted string. */ toString() {
166
+ return (0, $fae977aafc393c5c$export$4223de14708adc63)(this);
167
+ }
168
+ /** 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) {
169
+ let res = (0, $14e0f24ef4ac5c92$export$68781ddf31c0090f)(this, b);
170
+ if (res === 0) return (0, $14e0f24ef4ac5c92$export$c19a80a9721b80f6)(this, (0, $11d87f3f76e88657$export$b21e0b124e224484)(b));
171
+ return res;
172
+ }
173
+ constructor(...args){
174
+ (0, $aksy1$_)(this, $35ea8db9cb2ccb90$var$_type2, {
175
+ writable: true,
176
+ value: void 0
177
+ });
178
+ let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
179
+ this.calendar = calendar;
180
+ this.era = era;
181
+ this.year = year;
182
+ this.month = month;
183
+ this.day = day;
184
+ this.hour = args.shift() || 0;
185
+ this.minute = args.shift() || 0;
186
+ this.second = args.shift() || 0;
187
+ this.millisecond = args.shift() || 0;
188
+ (0, $735220c2d4774dd3$export$c4e2ecac49351ef2)(this);
189
+ }
190
+ }
191
+ var // This prevents TypeScript from allowing other types with the same fields to match.
192
+ // @ts-ignore
193
+ $35ea8db9cb2ccb90$var$_type3 = /*#__PURE__*/ new WeakMap();
194
+ class $35ea8db9cb2ccb90$export$d3b7288e7994edea {
195
+ /** Returns a copy of this date. */ copy() {
196
+ if (this.era) return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
197
+ else return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
198
+ }
199
+ /** Returns a new `ZonedDateTime` with the given duration added to it. */ add(duration) {
200
+ return (0, $735220c2d4774dd3$export$96b1d28349274637)(this, duration);
201
+ }
202
+ /** Returns a new `ZonedDateTime` with the given duration subtracted from it. */ subtract(duration) {
203
+ return (0, $735220c2d4774dd3$export$6814caac34ca03c7)(this, duration);
204
+ }
205
+ /** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields, disambiguation) {
206
+ return (0, $735220c2d4774dd3$export$31b5430eb18be4f8)(this, fields, disambiguation);
207
+ }
208
+ /**
209
+ * Returns a new `ZonedDateTime` with the given field adjusted by a specified amount.
210
+ * When the resulting value reaches the limits of the field, it wraps around.
211
+ */ cycle(field, amount, options) {
212
+ return (0, $735220c2d4774dd3$export$9a297d111fc86b79)(this, field, amount, options);
213
+ }
214
+ /** Converts the date to a native JavaScript Date object. */ toDate() {
215
+ return (0, $11d87f3f76e88657$export$83aac07b4c37b25)(this);
216
+ }
217
+ /** Converts the date to an ISO 8601 formatted string, including the UTC offset and time zone identifier. */ toString() {
218
+ return (0, $fae977aafc393c5c$export$bf79f1ebf4b18792)(this);
219
+ }
220
+ /** Converts the date to an ISO 8601 formatted string in UTC. */ toAbsoluteString() {
221
+ return this.toDate().toISOString();
222
+ }
223
+ /** 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) {
224
+ // TODO: Is this a bad idea??
225
+ return this.toDate().getTime() - (0, $11d87f3f76e88657$export$84c95a83c799e074)(b, this.timeZone).toDate().getTime();
226
+ }
227
+ constructor(...args){
228
+ (0, $aksy1$_)(this, $35ea8db9cb2ccb90$var$_type3, {
229
+ writable: true,
230
+ value: void 0
231
+ });
232
+ let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
233
+ let timeZone = args.shift();
234
+ let offset = args.shift();
235
+ this.calendar = calendar;
236
+ this.era = era;
237
+ this.year = year;
238
+ this.month = month;
239
+ this.day = day;
240
+ this.timeZone = timeZone;
241
+ this.offset = offset;
242
+ this.hour = args.shift() || 0;
243
+ this.minute = args.shift() || 0;
244
+ this.second = args.shift() || 0;
245
+ this.millisecond = args.shift() || 0;
246
+ (0, $735220c2d4774dd3$export$c4e2ecac49351ef2)(this);
247
+ }
248
+ }
249
+
250
+
251
+ export {$35ea8db9cb2ccb90$export$99faa760c7908e4f as CalendarDate, $35ea8db9cb2ccb90$export$680ea196effce5f as Time, $35ea8db9cb2ccb90$export$ca871e8dbb80966f as CalendarDateTime, $35ea8db9cb2ccb90$export$d3b7288e7994edea as ZonedDateTime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AAO,CAAA,GAAA,yCAAS,EAAE,IAAI,EAAE,OAAO,QAAQ;IACzC;IAEA,0DAA0D,GAC1D,SAAS;QACP,OAAO,CAAA,GAAA,wCAAU,EAAE,IAAI;IACzB;IAEC,0GAA0G,GAC3G,WAAW;QACT,OAAO,CAAA,GAAA,yCAAoB,EAAE,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,yCAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAC7E;IAtEA,YAAY,GAAG,IAAW,CAAE;QAhC5B,oBAAA;;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,yCAAQ,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.module.js.map"}