@react-stately/datepicker 3.15.3 → 3.16.0

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.
@@ -0,0 +1,335 @@
1
+ var $8WOBg$internationalizeddate = require("@internationalized/date");
2
+
3
+
4
+ function $parcel$export(e, n, v, s) {
5
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
6
+ }
7
+
8
+ $parcel$export(module.exports, "IncompleteDate", () => $fd62790d5a95383f$export$ae165b50d181e1ef);
9
+ /*
10
+ * Copyright 2026 Adobe. All rights reserved.
11
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
12
+ * you may not use this file except in compliance with the License. You may obtain a copy
13
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software distributed under
16
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
17
+ * OF ANY KIND, either express or implied. See the License for the specific language
18
+ * governing permissions and limitations under the License.
19
+ */
20
+ class $fd62790d5a95383f$export$ae165b50d181e1ef {
21
+ copy() {
22
+ let res = new $fd62790d5a95383f$export$ae165b50d181e1ef(this.calendar, this.hourCycle);
23
+ res.era = this.era;
24
+ res.year = this.year;
25
+ res.month = this.month;
26
+ res.day = this.day;
27
+ res.hour = this.hour;
28
+ res.dayPeriod = this.dayPeriod;
29
+ res.minute = this.minute;
30
+ res.second = this.second;
31
+ res.millisecond = this.millisecond;
32
+ res.offset = this.offset;
33
+ return res;
34
+ }
35
+ /** Checks whether all the specified segments have a value. */ isComplete(segments) {
36
+ return segments.every((segment)=>this[segment] != null);
37
+ }
38
+ /** Checks whether the given date value matches this value for the specified segments. */ validate(dt, segments) {
39
+ return segments.every((segment)=>{
40
+ if ((segment === 'hour' || segment === 'dayPeriod') && 'hour' in dt) {
41
+ let [dayPeriod, hour] = $fd62790d5a95383f$var$toHourCycle(dt.hour, this.hourCycle);
42
+ return this.dayPeriod === dayPeriod && this.hour === hour;
43
+ }
44
+ return this[segment] === dt[segment];
45
+ });
46
+ }
47
+ /** Checks if the date is empty (i.e. all specified segments are null). */ isCleared(segments) {
48
+ return segments.every((segment)=>this[segment] === null);
49
+ }
50
+ /** Sets the given field. */ set(field, value, placeholder) {
51
+ let result = this.copy();
52
+ result[field] = value;
53
+ if (field === 'hour' && result.dayPeriod == null && 'hour' in placeholder) result.dayPeriod = $fd62790d5a95383f$var$toHourCycle(placeholder.hour, this.hourCycle)[0];
54
+ if (field === 'year' && result.era == null) result.era = placeholder.era;
55
+ // clear offset when a date/time field changes since it may no longer be valid
56
+ if (field !== 'second' && field !== 'literal' && field !== 'timeZoneName') result.offset = null;
57
+ return result;
58
+ }
59
+ /** Sets the given field to null. */ clear(field) {
60
+ let result = this.copy();
61
+ // @ts-ignore
62
+ result[field] = null;
63
+ if (field === 'year') result.era = null;
64
+ // clear offset when a field is cleared since it may no longer be valid
65
+ result.offset = null;
66
+ return result;
67
+ }
68
+ /** Increments or decrements the given field. If it is null, then it is set to the placeholder value. */ cycle(field, amount, placeholder, displaySegments) {
69
+ let res = this.copy();
70
+ // If field is null, default to placeholder.
71
+ if (res[field] == null && field !== 'dayPeriod' && field !== 'era') {
72
+ if (field === 'hour' && 'hour' in placeholder) {
73
+ let [dayPeriod, hour] = $fd62790d5a95383f$var$toHourCycle(placeholder.hour, this.hourCycle);
74
+ res.dayPeriod = dayPeriod;
75
+ res.hour = hour;
76
+ } else res[field] = placeholder[field];
77
+ if (field === 'year' && res.era == null) res.era = placeholder.era;
78
+ return res;
79
+ }
80
+ switch(field){
81
+ case 'era':
82
+ {
83
+ let eras = this.calendar.getEras();
84
+ let index = eras.indexOf(res.era);
85
+ index = $fd62790d5a95383f$var$cycleValue(index, amount, 0, eras.length - 1);
86
+ res.era = eras[index];
87
+ break;
88
+ }
89
+ case 'year':
90
+ {
91
+ var _this_era, _this_year, _this_month, _this_day;
92
+ // Use CalendarDate to cycle so that we update the era when going between 1 AD and 1 BC.
93
+ let date = new (0, $8WOBg$internationalizeddate.CalendarDate)(this.calendar, (_this_era = this.era) !== null && _this_era !== void 0 ? _this_era : placeholder.era, (_this_year = this.year) !== null && _this_year !== void 0 ? _this_year : placeholder.year, (_this_month = this.month) !== null && _this_month !== void 0 ? _this_month : 1, (_this_day = this.day) !== null && _this_day !== void 0 ? _this_day : 1);
94
+ date = date.cycle(field, amount, {
95
+ round: field === 'year'
96
+ });
97
+ res.era = date.era;
98
+ res.year = date.year;
99
+ break;
100
+ }
101
+ case 'month':
102
+ var _res_month;
103
+ res.month = $fd62790d5a95383f$var$cycleValue((_res_month = res.month) !== null && _res_month !== void 0 ? _res_month : 1, amount, 1, this.calendar.getMaximumMonthsInYear());
104
+ break;
105
+ case 'day':
106
+ var _res_day;
107
+ // Allow incrementing up to the maximum number of days in any month.
108
+ res.day = $fd62790d5a95383f$var$cycleValue((_res_day = res.day) !== null && _res_day !== void 0 ? _res_day : 1, amount, 1, this.calendar.getMaximumDaysInMonth());
109
+ break;
110
+ case 'hour':
111
+ {
112
+ // if date is fully defined or it is just a time field, and we have a time zone, use toValue to get a ZonedDateTime to cycle
113
+ // so DST fallback is properly handled
114
+ let hasDateSegements = displaySegments.some((s)=>[
115
+ 'year',
116
+ 'month',
117
+ 'day'
118
+ ].includes(s));
119
+ if ('timeZone' in placeholder && (!hasDateSegements || res.year != null && res.month != null && res.day != null)) {
120
+ let date = this.toValue(placeholder);
121
+ date = date.cycle('hour', amount, {
122
+ hourCycle: this.hourCycle === 'h12' ? 12 : 24,
123
+ round: false
124
+ });
125
+ let [dayPeriod, adjustedHour] = $fd62790d5a95383f$var$toHourCycle(date.hour, this.hourCycle);
126
+ res.hour = adjustedHour;
127
+ res.dayPeriod = dayPeriod;
128
+ res.offset = date.offset;
129
+ } else {
130
+ var _res_hour;
131
+ let hours = (_res_hour = res.hour) !== null && _res_hour !== void 0 ? _res_hour : 0;
132
+ let limits = this.getSegmentLimits('hour');
133
+ res.hour = $fd62790d5a95383f$var$cycleValue(hours, amount, limits.minValue, limits.maxValue);
134
+ if (res.dayPeriod == null && 'hour' in placeholder) res.dayPeriod = $fd62790d5a95383f$var$toHourCycle(placeholder.hour, this.hourCycle)[0];
135
+ }
136
+ break;
137
+ }
138
+ case 'dayPeriod':
139
+ var _res_dayPeriod;
140
+ res.dayPeriod = $fd62790d5a95383f$var$cycleValue((_res_dayPeriod = res.dayPeriod) !== null && _res_dayPeriod !== void 0 ? _res_dayPeriod : 0, amount, 0, 1);
141
+ break;
142
+ case 'minute':
143
+ var _res_minute;
144
+ res.minute = $fd62790d5a95383f$var$cycleValue((_res_minute = res.minute) !== null && _res_minute !== void 0 ? _res_minute : 0, amount, 0, 59, true);
145
+ break;
146
+ case 'second':
147
+ var _res_second;
148
+ res.second = $fd62790d5a95383f$var$cycleValue((_res_second = res.second) !== null && _res_second !== void 0 ? _res_second : 0, amount, 0, 59, true);
149
+ break;
150
+ }
151
+ return res;
152
+ }
153
+ /** Converts the incomplete date to a full date value, using the provided value for any unset fields. */ toValue(value) {
154
+ var _this_era, _this_year, _this_month, _this_day;
155
+ if ('hour' in value) {
156
+ let hour = this.hour;
157
+ var _this_dayPeriod;
158
+ if (hour != null) hour = $fd62790d5a95383f$var$fromHourCycle(hour, (_this_dayPeriod = this.dayPeriod) !== null && _this_dayPeriod !== void 0 ? _this_dayPeriod : 0, this.hourCycle);
159
+ else if (this.hourCycle === 'h12' || this.hourCycle === 'h11') hour = this.dayPeriod === 1 ? 12 : 0;
160
+ var _this_era1, _this_year1, _this_month1, _this_day1, _this_minute, _this_second, _this_millisecond;
161
+ let res = value.set({
162
+ era: (_this_era1 = this.era) !== null && _this_era1 !== void 0 ? _this_era1 : value.era,
163
+ year: (_this_year1 = this.year) !== null && _this_year1 !== void 0 ? _this_year1 : value.year,
164
+ month: (_this_month1 = this.month) !== null && _this_month1 !== void 0 ? _this_month1 : value.month,
165
+ day: (_this_day1 = this.day) !== null && _this_day1 !== void 0 ? _this_day1 : value.day,
166
+ hour: hour !== null && hour !== void 0 ? hour : value.hour,
167
+ minute: (_this_minute = this.minute) !== null && _this_minute !== void 0 ? _this_minute : value.minute,
168
+ second: (_this_second = this.second) !== null && _this_second !== void 0 ? _this_second : value.second,
169
+ millisecond: (_this_millisecond = this.millisecond) !== null && _this_millisecond !== void 0 ? _this_millisecond : value.millisecond
170
+ });
171
+ if ('offset' in res && this.offset != null && res.offset !== this.offset) res = res.add({
172
+ milliseconds: res.offset - this.offset
173
+ });
174
+ return res;
175
+ } else return value.set({
176
+ era: (_this_era = this.era) !== null && _this_era !== void 0 ? _this_era : value.era,
177
+ year: (_this_year = this.year) !== null && _this_year !== void 0 ? _this_year : value.year,
178
+ month: (_this_month = this.month) !== null && _this_month !== void 0 ? _this_month : value.month,
179
+ day: (_this_day = this.day) !== null && _this_day !== void 0 ? _this_day : value.day
180
+ });
181
+ }
182
+ getSegmentLimits(type) {
183
+ switch(type){
184
+ case 'era':
185
+ {
186
+ let eras = this.calendar.getEras();
187
+ return {
188
+ value: this.era != null ? eras.indexOf(this.era) : eras.length - 1,
189
+ minValue: 0,
190
+ maxValue: eras.length - 1
191
+ };
192
+ }
193
+ case 'year':
194
+ return {
195
+ value: this.year,
196
+ minValue: 1,
197
+ maxValue: 9999
198
+ };
199
+ case 'month':
200
+ return {
201
+ value: this.month,
202
+ minValue: 1,
203
+ maxValue: this.calendar.getMaximumMonthsInYear()
204
+ };
205
+ case 'day':
206
+ return {
207
+ value: this.day,
208
+ minValue: 1,
209
+ maxValue: this.calendar.getMaximumDaysInMonth()
210
+ };
211
+ case 'dayPeriod':
212
+ return {
213
+ value: this.dayPeriod,
214
+ minValue: 0,
215
+ maxValue: 1
216
+ };
217
+ case 'hour':
218
+ {
219
+ let minValue = 0;
220
+ let maxValue = 23;
221
+ if (this.hourCycle === 'h12') {
222
+ minValue = 1;
223
+ maxValue = 12;
224
+ } else if (this.hourCycle === 'h11') {
225
+ minValue = 0;
226
+ maxValue = 11;
227
+ }
228
+ return {
229
+ value: this.hour,
230
+ minValue: minValue,
231
+ maxValue: maxValue
232
+ };
233
+ }
234
+ case 'minute':
235
+ return {
236
+ value: this.minute,
237
+ minValue: 0,
238
+ maxValue: 59
239
+ };
240
+ case 'second':
241
+ return {
242
+ value: this.second,
243
+ minValue: 0,
244
+ maxValue: 59
245
+ };
246
+ }
247
+ }
248
+ constructor(calendar, hourCycle, dateValue){
249
+ var _dateValue_era;
250
+ this.era = (_dateValue_era = dateValue === null || dateValue === void 0 ? void 0 : dateValue.era) !== null && _dateValue_era !== void 0 ? _dateValue_era : null;
251
+ this.calendar = calendar;
252
+ var _dateValue_year;
253
+ this.year = (_dateValue_year = dateValue === null || dateValue === void 0 ? void 0 : dateValue.year) !== null && _dateValue_year !== void 0 ? _dateValue_year : null;
254
+ var _dateValue_month;
255
+ this.month = (_dateValue_month = dateValue === null || dateValue === void 0 ? void 0 : dateValue.month) !== null && _dateValue_month !== void 0 ? _dateValue_month : null;
256
+ var _dateValue_day;
257
+ this.day = (_dateValue_day = dateValue === null || dateValue === void 0 ? void 0 : dateValue.day) !== null && _dateValue_day !== void 0 ? _dateValue_day : null;
258
+ var _dateValue_hour;
259
+ this.hour = (_dateValue_hour = dateValue === null || dateValue === void 0 ? void 0 : dateValue.hour) !== null && _dateValue_hour !== void 0 ? _dateValue_hour : null;
260
+ this.hourCycle = hourCycle;
261
+ this.dayPeriod = null;
262
+ var _dateValue_minute;
263
+ this.minute = (_dateValue_minute = dateValue === null || dateValue === void 0 ? void 0 : dateValue.minute) !== null && _dateValue_minute !== void 0 ? _dateValue_minute : null;
264
+ var _dateValue_second;
265
+ this.second = (_dateValue_second = dateValue === null || dateValue === void 0 ? void 0 : dateValue.second) !== null && _dateValue_second !== void 0 ? _dateValue_second : null;
266
+ var _dateValue_millisecond;
267
+ this.millisecond = (_dateValue_millisecond = dateValue === null || dateValue === void 0 ? void 0 : dateValue.millisecond) !== null && _dateValue_millisecond !== void 0 ? _dateValue_millisecond : null;
268
+ this.offset = 'offset' in (dateValue !== null && dateValue !== void 0 ? dateValue : {}) ? dateValue.offset : null;
269
+ // Convert the hour from 24 hour time to the given hour cycle.
270
+ if (this.hour != null) {
271
+ let [dayPeriod, hour] = $fd62790d5a95383f$var$toHourCycle(this.hour, hourCycle);
272
+ this.dayPeriod = dayPeriod;
273
+ this.hour = hour;
274
+ }
275
+ }
276
+ }
277
+ function $fd62790d5a95383f$var$cycleValue(value, amount, min, max, round = false) {
278
+ if (round) {
279
+ value += Math.sign(amount);
280
+ if (value < min) value = max;
281
+ let div = Math.abs(amount);
282
+ if (amount > 0) value = Math.ceil(value / div) * div;
283
+ else value = Math.floor(value / div) * div;
284
+ if (value > max) value = min;
285
+ } else {
286
+ value += amount;
287
+ if (value < min) value = max - (min - value - 1);
288
+ else if (value > max) value = min + (value - max - 1);
289
+ }
290
+ return value;
291
+ }
292
+ function $fd62790d5a95383f$var$toHourCycle(hour, hourCycle) {
293
+ let dayPeriod = hour >= 12 ? 1 : 0;
294
+ switch(hourCycle){
295
+ case 'h11':
296
+ // Hours are numbered from 0 to 11. Used in Japan.
297
+ if (hour >= 12) hour -= 12;
298
+ break;
299
+ case 'h12':
300
+ // Hours are numbered from 12 (representing 0) to 11.
301
+ if (hour === 0) hour = 12;
302
+ else if (hour > 12) hour -= 12;
303
+ break;
304
+ case 'h23':
305
+ // 24 hour time, numbered 0 to 23.
306
+ dayPeriod = null;
307
+ break;
308
+ case 'h24':
309
+ // 24 hour time numbered 24 to 23. Unused but supported by Intl.DateTimeFormat.
310
+ hour += 1;
311
+ dayPeriod = null;
312
+ }
313
+ return [
314
+ dayPeriod,
315
+ hour
316
+ ];
317
+ }
318
+ function $fd62790d5a95383f$var$fromHourCycle(hour, dayPeriod, hourCycle) {
319
+ switch(hourCycle){
320
+ case 'h11':
321
+ if (dayPeriod === 1) hour += 12;
322
+ break;
323
+ case 'h12':
324
+ if (hour === 12) hour = 0;
325
+ if (dayPeriod === 1) hour += 12;
326
+ break;
327
+ case 'h24':
328
+ hour -= 1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E,OAAQ;QACN,KAAK;YACH,IAAI,cAAc,GAChB,QAAQ;YAEV;QACF,KAAK;YACH,IAAI,SAAS,IACX,OAAO;YAET,IAAI,cAAc,GAChB,QAAQ;YAEV;QACF,KAAK;YACH,QAAQ;YACR;IACJ;IAEA,OAAO;AACT","sources":["packages/@react-stately/datepicker/src/IncompleteDate.ts"],"sourcesContent":["/*\n * Copyright 2026 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 {AnyDateTime, Calendar, CalendarDate, ZonedDateTime} from '@internationalized/date';\nimport {DateValue} from '@react-types/datepicker';\nimport {SegmentType} from './useDateFieldState';\n\ntype HourCycle = 'h12' | 'h11' | 'h23' | 'h24';\n\n/**\n * This class represents a date that is incomplete or otherwise invalid as a result of user editing.\n * For example, it can represent temporary dates such as February 31st if the user edits the day before the month.\n * Times are represented according to an hour cycle rather than always in 24 hour time. This enables the user to adjust\n * the day period (e.g. am/pm) independently from the hour.\n */\nexport class IncompleteDate {\n calendar: Calendar;\n era: string | null;\n year: number | null;\n month: number | null;\n day: number | null;\n hour: number | null;\n hourCycle: HourCycle;\n dayPeriod: number | null;\n minute: number | null;\n second: number | null;\n millisecond: number | null;\n offset: number | null;\n\n constructor(calendar: Calendar, hourCycle: HourCycle, dateValue?: Partial<Omit<AnyDateTime, 'copy'>> | null) {\n this.era = dateValue?.era ?? null;\n this.calendar = calendar;\n this.year = dateValue?.year ?? null;\n this.month = dateValue?.month ?? null;\n this.day = dateValue?.day ?? null;\n this.hour = dateValue?.hour ?? null;\n this.hourCycle = hourCycle;\n this.dayPeriod = null;\n this.minute = dateValue?.minute ?? null;\n this.second = dateValue?.second ?? null;\n this.millisecond = dateValue?.millisecond ?? null;\n this.offset = 'offset' in (dateValue ?? {}) ? (dateValue as any).offset : null;\n\n // Convert the hour from 24 hour time to the given hour cycle.\n if (this.hour != null) {\n let [dayPeriod, hour] = toHourCycle(this.hour, hourCycle);\n this.dayPeriod = dayPeriod;\n this.hour = hour;\n }\n }\n\n copy(): IncompleteDate {\n let res = new IncompleteDate(this.calendar, this.hourCycle);\n res.era = this.era;\n res.year = this.year;\n res.month = this.month;\n res.day = this.day;\n res.hour = this.hour;\n res.dayPeriod = this.dayPeriod;\n res.minute = this.minute;\n res.second = this.second;\n res.millisecond = this.millisecond;\n res.offset = this.offset;\n return res;\n }\n\n /** Checks whether all the specified segments have a value. */\n isComplete(segments: SegmentType[]) {\n return segments.every(segment => this[segment] != null);\n }\n\n /** Checks whether the given date value matches this value for the specified segments. */\n validate(dt: DateValue, segments: SegmentType[]) {\n return segments.every(segment => {\n if ((segment === 'hour' || segment === 'dayPeriod') && 'hour' in dt) {\n let [dayPeriod, hour] = toHourCycle(dt.hour, this.hourCycle);\n return this.dayPeriod === dayPeriod && this.hour === hour;\n }\n return this[segment] === dt[segment];\n });\n }\n\n /** Checks if the date is empty (i.e. all specified segments are null). */\n isCleared(segments: SegmentType[]): boolean {\n return segments.every(segment => this[segment] === null);\n }\n\n /** Sets the given field. */\n set(field: SegmentType, value: number | string, placeholder: DateValue): IncompleteDate {\n let result = this.copy();\n result[field] = value;\n if (field === 'hour' && result.dayPeriod == null && 'hour' in placeholder) {\n result.dayPeriod = toHourCycle(placeholder.hour, this.hourCycle)[0];\n }\n if (field === 'year' && result.era == null) {\n result.era = placeholder.era;\n }\n\n // clear offset when a date/time field changes since it may no longer be valid\n if (field !== 'second' && field !== 'literal' && field !== 'timeZoneName') {\n result.offset = null;\n }\n return result;\n }\n\n /** Sets the given field to null. */\n clear(field: SegmentType): IncompleteDate {\n let result = this.copy();\n // @ts-ignore\n result[field] = null;\n if (field === 'year') {\n result.era = null;\n }\n\n // clear offset when a field is cleared since it may no longer be valid\n result.offset = null;\n return result;\n }\n\n /** Increments or decrements the given field. If it is null, then it is set to the placeholder value. */\n cycle(field: SegmentType, amount: number, placeholder: DateValue, displaySegments: SegmentType[]): IncompleteDate {\n let res = this.copy();\n\n // If field is null, default to placeholder.\n if (res[field] == null && field !== 'dayPeriod' && field !== 'era') {\n if (field === 'hour' && 'hour' in placeholder) {\n let [dayPeriod, hour] = toHourCycle(placeholder.hour, this.hourCycle);\n res.dayPeriod = dayPeriod;\n res.hour = hour;\n } else {\n res[field] = placeholder[field];\n }\n if (field === 'year' && res.era == null) {\n res.era = placeholder.era;\n }\n\n return res;\n }\n\n switch (field) {\n case 'era': {\n let eras = this.calendar.getEras();\n let index = eras.indexOf(res.era!);\n index = cycleValue(index, amount, 0, eras.length - 1);\n res.era = eras[index];\n break;\n }\n case 'year': {\n // Use CalendarDate to cycle so that we update the era when going between 1 AD and 1 BC.\n let date = new CalendarDate(this.calendar, this.era ?? placeholder.era, this.year ?? placeholder.year, this.month ?? 1, this.day ?? 1);\n date = date.cycle(field, amount, {round: field === 'year'});\n res.era = date.era;\n res.year = date.year;\n break;\n }\n case 'month':\n res.month = cycleValue(res.month ?? 1, amount, 1, this.calendar.getMaximumMonthsInYear());\n break;\n case 'day':\n // Allow incrementing up to the maximum number of days in any month.\n res.day = cycleValue(res.day ?? 1, amount, 1, this.calendar.getMaximumDaysInMonth());\n break;\n case 'hour': {\n // if date is fully defined or it is just a time field, and we have a time zone, use toValue to get a ZonedDateTime to cycle\n // so DST fallback is properly handled\n let hasDateSegements = displaySegments.some(s => ['year', 'month', 'day'].includes(s));\n if ('timeZone' in placeholder && (!hasDateSegements || (res.year != null && res.month != null && res.day != null))) {\n let date = this.toValue(placeholder) as ZonedDateTime;\n date = date.cycle('hour', amount, {hourCycle: this.hourCycle === 'h12' ? 12 : 24, round: false});\n let [dayPeriod, adjustedHour] = toHourCycle(date.hour, this.hourCycle);\n res.hour = adjustedHour;\n res.dayPeriod = dayPeriod;\n res.offset = date.offset;\n } else {\n let hours = res.hour ?? 0;\n let limits = this.getSegmentLimits('hour')!;\n res.hour = cycleValue(hours, amount, limits.minValue, limits.maxValue);\n if (res.dayPeriod == null && 'hour' in placeholder) {\n res.dayPeriod = toHourCycle(placeholder.hour, this.hourCycle)[0];\n }\n }\n break;\n }\n case 'dayPeriod':\n res.dayPeriod = cycleValue(res.dayPeriod ?? 0, amount, 0, 1);\n break;\n case 'minute':\n res.minute = cycleValue(res.minute ?? 0, amount, 0, 59, true);\n break;\n case 'second':\n res.second = cycleValue(res.second ?? 0, amount, 0, 59, true);\n break;\n }\n\n return res;\n }\n\n /** Converts the incomplete date to a full date value, using the provided value for any unset fields. */\n toValue(value: DateValue): DateValue {\n if ('hour' in value) {\n let hour = this.hour;\n if (hour != null) {\n hour = fromHourCycle(hour, this.dayPeriod ?? 0, this.hourCycle);\n } else if (this.hourCycle === 'h12' || this.hourCycle === 'h11') {\n hour = this.dayPeriod === 1 ? 12 : 0;\n }\n\n let res = value.set({\n era: this.era ?? value.era,\n year: this.year ?? value.year,\n month: this.month ?? value.month,\n day: this.day ?? value.day,\n hour: hour ?? value.hour,\n minute: this.minute ?? value.minute,\n second: this.second ?? value.second,\n millisecond: this.millisecond ?? value.millisecond\n });\n\n if ('offset' in res && this.offset != null && res.offset !== this.offset) {\n res = res.add({milliseconds: res.offset - this.offset});\n }\n\n return res;\n } else {\n return value.set({\n era: this.era ?? value.era,\n year: this.year ?? value.year,\n month: this.month ?? value.month,\n day: this.day ?? value.day\n });\n }\n }\n\n getSegmentLimits(type: string): {value: number | null, minValue: number, maxValue: number} | undefined {\n switch (type) {\n case 'era': {\n let eras = this.calendar.getEras();\n return {\n value: this.era != null ? eras.indexOf(this.era) : eras.length - 1,\n minValue: 0,\n maxValue: eras.length - 1\n };\n }\n case 'year':\n return {\n value: this.year,\n minValue: 1,\n maxValue: 9999\n };\n case 'month':\n return {\n value: this.month,\n minValue: 1,\n maxValue: this.calendar.getMaximumMonthsInYear()\n };\n case 'day':\n return {\n value: this.day,\n minValue: 1,\n maxValue: this.calendar.getMaximumDaysInMonth()\n };\n case 'dayPeriod': {\n return {\n value: this.dayPeriod,\n minValue: 0,\n maxValue: 1\n };\n }\n case 'hour': {\n let minValue = 0;\n let maxValue = 23;\n if (this.hourCycle === 'h12') {\n minValue = 1;\n maxValue = 12;\n } else if (this.hourCycle === 'h11') {\n minValue = 0;\n maxValue = 11;\n }\n\n return {\n value: this.hour,\n minValue,\n maxValue\n };\n }\n case 'minute':\n return {\n value: this.minute,\n minValue: 0,\n maxValue: 59\n };\n case 'second':\n return {\n value: this.second,\n minValue: 0,\n maxValue: 59\n };\n }\n }\n}\n\nfunction cycleValue(value: number, amount: number, min: number, max: number, round = false) {\n if (round) {\n value += Math.sign(amount);\n\n if (value < min) {\n value = max;\n }\n\n let div = Math.abs(amount);\n if (amount > 0) {\n value = Math.ceil(value / div) * div;\n } else {\n value = Math.floor(value / div) * div;\n }\n\n if (value > max) {\n value = min;\n }\n } else {\n value += amount;\n if (value < min) {\n value = max - (min - value - 1);\n } else if (value > max) {\n value = min + (value - max - 1);\n }\n }\n\n return value;\n}\n\nfunction toHourCycle(hour: number, hourCycle: HourCycle): [number | null, number] {\n let dayPeriod: number | null = hour >= 12 ? 1 : 0;\n switch (hourCycle) {\n case 'h11':\n // Hours are numbered from 0 to 11. Used in Japan.\n if (hour >= 12) {\n hour -= 12;\n }\n break;\n case 'h12':\n // Hours are numbered from 12 (representing 0) to 11.\n if (hour === 0) {\n hour = 12;\n } else if (hour > 12) {\n hour -= 12;\n }\n break;\n case 'h23':\n // 24 hour time, numbered 0 to 23.\n dayPeriod = null;\n break;\n case 'h24':\n // 24 hour time numbered 24 to 23. Unused but supported by Intl.DateTimeFormat.\n hour += 1;\n dayPeriod = null;\n }\n\n return [dayPeriod, hour];\n}\n\nfunction fromHourCycle(hour: number, dayPeriod: number, hourCycle: HourCycle): number {\n switch (hourCycle) {\n case 'h11':\n if (dayPeriod === 1) {\n hour += 12;\n }\n break;\n case 'h12':\n if (hour === 12) {\n hour = 0;\n }\n if (dayPeriod === 1) {\n hour += 12;\n }\n break;\n case 'h24':\n hour -= 1;\n break;\n }\n\n return hour;\n}\n"],"names":[],"version":3,"file":"IncompleteDate.main.js.map"}