@timestamp-js/core 0.1.0-rc.2 → 0.1.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/calendar.d.ts +50 -0
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +45 -0
- package/dist/calendar.js.map +1 -1
- package/dist/index.d.ts +451 -68
- package/dist/index.d.ts.map +1 -1
- package/dist/index.global.js +404 -117
- package/dist/index.global.min.js +1 -1
- package/dist/index.js +634 -167
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.global.js
CHANGED
|
@@ -39,7 +39,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
39
39
|
return padded;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
function formatCalendarDate(date) {
|
|
42
|
+
function formatCalendarDate$1(date) {
|
|
43
43
|
return `${padNumber$1(date.year, 4)}-${padNumber$1(date.month, 2)}-${padNumber$1(date.day, 2)}`;
|
|
44
44
|
}
|
|
45
45
|
function fromUtcDate(date) {
|
|
@@ -57,6 +57,17 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
57
57
|
id: "gregorian",
|
|
58
58
|
intlCalendar: "gregory",
|
|
59
59
|
label: "Gregorian",
|
|
60
|
+
defaultLocale: "en-US",
|
|
61
|
+
defaultDirection: "ltr",
|
|
62
|
+
defaultWeekdays: Object.freeze([
|
|
63
|
+
0,
|
|
64
|
+
1,
|
|
65
|
+
2,
|
|
66
|
+
3,
|
|
67
|
+
4,
|
|
68
|
+
5,
|
|
69
|
+
6
|
|
70
|
+
]),
|
|
60
71
|
monthsInYear() {
|
|
61
72
|
return 12;
|
|
62
73
|
},
|
|
@@ -93,8 +104,52 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
93
104
|
return toGregorianUtcDate(date).getUTCDay();
|
|
94
105
|
}
|
|
95
106
|
});
|
|
107
|
+
|
|
108
|
+
function getCalendarLocale$1(calendar = gregorianCalendar) {
|
|
109
|
+
return calendar.defaultLocale ?? gregorianCalendar.defaultLocale ?? "en-US";
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function getCalendarDirection$1(calendar = gregorianCalendar) {
|
|
113
|
+
return calendar.defaultDirection ?? gregorianCalendar.defaultDirection ?? "ltr";
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function isCalendarRTL$1(calendar = gregorianCalendar) {
|
|
117
|
+
return getCalendarDirection$1(calendar) === "rtl";
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function getCalendarWeekdays$1(calendar = gregorianCalendar) {
|
|
121
|
+
return [...calendar.defaultWeekdays ?? gregorianCalendar.defaultWeekdays ?? [
|
|
122
|
+
0,
|
|
123
|
+
1,
|
|
124
|
+
2,
|
|
125
|
+
3,
|
|
126
|
+
4,
|
|
127
|
+
5,
|
|
128
|
+
6
|
|
129
|
+
]];
|
|
130
|
+
}
|
|
96
131
|
|
|
97
132
|
|
|
133
|
+
function formatCalendarDate(date) {
|
|
134
|
+
return formatCalendarDate$1(date);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function getCalendarLocale(calendar = gregorianCalendar) {
|
|
138
|
+
return getCalendarLocale$1(calendar);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function getCalendarDirection(calendar = gregorianCalendar) {
|
|
142
|
+
return getCalendarDirection$1(calendar);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function isCalendarRTL(calendar = gregorianCalendar) {
|
|
146
|
+
return isCalendarRTL$1(calendar);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function getCalendarWeekdays(calendar = gregorianCalendar) {
|
|
150
|
+
return getCalendarWeekdays$1(calendar);
|
|
151
|
+
}
|
|
152
|
+
|
|
98
153
|
const PARSE_DATETIME = /^(\d{4})-(\d{1,2})(?:-(\d{1,2}))?(?:[Tt\s]+(\d{1,2})(?::(\d{1,2}))?(?::(\d{1,2})(?:\.(\d{1,3}))?)?)?(?:\s*(Z|[+-]\d{2}:?\d{2}))?$/;
|
|
99
154
|
|
|
100
155
|
const PARSE_DATE = /^(\d{4})-(\d{1,2})(-(\d{1,2}))?/;
|
|
@@ -291,18 +346,23 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
291
346
|
timestamp.time = getTime(timestamp);
|
|
292
347
|
return freezeTimestamp(timestamp);
|
|
293
348
|
}
|
|
294
|
-
function parseDateByMode(date, utc) {
|
|
349
|
+
function parseDateByMode(date, utc, calendar = gregorianCalendar) {
|
|
295
350
|
if (!(date instanceof Date)) return null;
|
|
296
351
|
if (Number.isNaN(date.getTime())) return null;
|
|
297
352
|
const UTC = utc ? "UTC" : "";
|
|
353
|
+
const gregorian = {
|
|
354
|
+
year: date[`get${UTC}FullYear`](),
|
|
355
|
+
month: date[`get${UTC}Month`]() + 1,
|
|
356
|
+
day: date[`get${UTC}Date`]()
|
|
357
|
+
};
|
|
298
358
|
const second = date[`get${UTC}Seconds`]();
|
|
299
359
|
const millisecond = date[`get${UTC}Milliseconds`]();
|
|
300
360
|
const timestamp = {
|
|
301
|
-
date:
|
|
361
|
+
date: formatCalendarDate(gregorian),
|
|
302
362
|
time: padNumber(date[`get${UTC}Hours`]() || 0, 2) + ":" + padNumber(date[`get${UTC}Minutes`]() || 0, 2),
|
|
303
|
-
year:
|
|
304
|
-
month:
|
|
305
|
-
day:
|
|
363
|
+
year: gregorian.year,
|
|
364
|
+
month: gregorian.month,
|
|
365
|
+
day: gregorian.day,
|
|
306
366
|
hour: date[`get${UTC}Hours`](),
|
|
307
367
|
minute: date[`get${UTC}Minutes`](),
|
|
308
368
|
weekday: 0,
|
|
@@ -317,15 +377,17 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
317
377
|
};
|
|
318
378
|
if (second !== 0) timestamp.second = second;
|
|
319
379
|
if (millisecond !== 0) timestamp.millisecond = millisecond;
|
|
320
|
-
|
|
380
|
+
const formatted = updateFormatted(timestamp);
|
|
381
|
+
if (calendar === gregorianCalendar) return formatted;
|
|
382
|
+
return createCalendarTimestampFromEpochDay(gregorianCalendar.toEpochDay(gregorian), calendar, { ...getCalendarTimestampOptions(formatted) });
|
|
321
383
|
}
|
|
322
384
|
|
|
323
|
-
function parseDate(date) {
|
|
324
|
-
return parseDateByMode(date, false);
|
|
385
|
+
function parseDate(date, calendar = gregorianCalendar) {
|
|
386
|
+
return parseDateByMode(date, false, calendar);
|
|
325
387
|
}
|
|
326
388
|
|
|
327
|
-
function parseDateUTC(date) {
|
|
328
|
-
return parseDateByMode(date, true);
|
|
389
|
+
function parseDateUTC(date, calendar = gregorianCalendar) {
|
|
390
|
+
return parseDateByMode(date, true, calendar);
|
|
329
391
|
}
|
|
330
392
|
|
|
331
393
|
function padNumber(x, length) {
|
|
@@ -334,95 +396,66 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
334
396
|
return padded;
|
|
335
397
|
}
|
|
336
398
|
|
|
337
|
-
function isLeapYear(year) {
|
|
338
|
-
return
|
|
399
|
+
function isLeapYear(year, calendar = gregorianCalendar) {
|
|
400
|
+
return calendar.isLeapYear(year);
|
|
339
401
|
}
|
|
340
402
|
|
|
341
|
-
function daysInMonth(year, month) {
|
|
342
|
-
return
|
|
403
|
+
function daysInMonth(year, month, calendar = gregorianCalendar) {
|
|
404
|
+
return calendar.daysInMonth(year, month);
|
|
343
405
|
}
|
|
344
406
|
|
|
345
|
-
function nextDay(timestamp) {
|
|
346
|
-
|
|
347
|
-
return updateFormatted(normalizeTimestamp({
|
|
348
|
-
...timestamp,
|
|
349
|
-
year: date.year,
|
|
350
|
-
month: date.month,
|
|
351
|
-
day: date.day
|
|
352
|
-
}));
|
|
407
|
+
function nextDay(timestamp, calendar = gregorianCalendar) {
|
|
408
|
+
return nextCalendarDay(timestamp, calendar);
|
|
353
409
|
}
|
|
354
410
|
|
|
355
|
-
function prevDay(timestamp) {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
411
|
+
function prevDay(timestamp, calendar = gregorianCalendar) {
|
|
412
|
+
return prevCalendarDay(timestamp, calendar);
|
|
413
|
+
}
|
|
414
|
+
function formatCalendarDateFromDate(date, utc, calendar = gregorianCalendar) {
|
|
415
|
+
const UTC = utc ? "UTC" : "";
|
|
416
|
+
const gregorian = {
|
|
417
|
+
year: date[`get${UTC}FullYear`](),
|
|
418
|
+
month: date[`get${UTC}Month`]() + 1,
|
|
419
|
+
day: date[`get${UTC}Date`]()
|
|
420
|
+
};
|
|
421
|
+
const epochDay = gregorianCalendar.toEpochDay(gregorian);
|
|
422
|
+
return formatCalendarDate(calendar.fromEpochDay(epochDay));
|
|
363
423
|
}
|
|
364
424
|
|
|
365
|
-
function today() {
|
|
366
|
-
|
|
367
|
-
return [
|
|
368
|
-
d.getFullYear(),
|
|
369
|
-
padNumber(month, 2),
|
|
370
|
-
padNumber(day, 2)
|
|
371
|
-
].join("-");
|
|
425
|
+
function today(calendar = gregorianCalendar) {
|
|
426
|
+
return formatCalendarDateFromDate(/* @__PURE__ */ new Date(), false, calendar);
|
|
372
427
|
}
|
|
373
428
|
|
|
374
|
-
function todayUTC(date = /* @__PURE__ */ new Date()) {
|
|
375
|
-
return
|
|
376
|
-
padNumber(date.getUTCFullYear(), 4),
|
|
377
|
-
padNumber(date.getUTCMonth() + 1, 2),
|
|
378
|
-
padNumber(date.getUTCDate(), 2)
|
|
379
|
-
].join("-");
|
|
429
|
+
function todayUTC(date = /* @__PURE__ */ new Date(), calendar = gregorianCalendar) {
|
|
430
|
+
return formatCalendarDateFromDate(date, true, calendar);
|
|
380
431
|
}
|
|
381
432
|
|
|
382
|
-
function nowUTC(date = /* @__PURE__ */ new Date()) {
|
|
383
|
-
return parseDateUTC(date);
|
|
433
|
+
function nowUTC(date = /* @__PURE__ */ new Date(), calendar = gregorianCalendar) {
|
|
434
|
+
return parseDateUTC(date, calendar);
|
|
384
435
|
}
|
|
385
436
|
|
|
386
|
-
function isToday(date) {
|
|
387
|
-
return date === today();
|
|
437
|
+
function isToday(date, calendar = gregorianCalendar) {
|
|
438
|
+
return date === today(calendar);
|
|
388
439
|
}
|
|
389
440
|
|
|
390
|
-
function isTodayUTC(date, now = /* @__PURE__ */ new Date()) {
|
|
391
|
-
return date === todayUTC(now);
|
|
441
|
+
function isTodayUTC(date, now = /* @__PURE__ */ new Date(), calendar = gregorianCalendar) {
|
|
442
|
+
return date === todayUTC(now, calendar);
|
|
392
443
|
}
|
|
393
444
|
|
|
394
|
-
function getStartOfWeek(timestamp, weekdays, today) {
|
|
395
|
-
|
|
396
|
-
if (!weekdays) return freezeTimestamp(start);
|
|
397
|
-
if (start.day === 1 || start.weekday === 0) while (!weekdays.includes(Number(start.weekday))) start = nextDay(start);
|
|
398
|
-
start = findWeekday(start, weekdays[0], prevDay);
|
|
399
|
-
start = updateFormatted(start);
|
|
400
|
-
if (today) start = updateRelative(start, today, start.hasTime);
|
|
401
|
-
return start;
|
|
445
|
+
function getStartOfWeek(timestamp, weekdays, today, calendar = gregorianCalendar) {
|
|
446
|
+
return getCalendarStartOfWeek(timestamp, weekdays, calendar, today);
|
|
402
447
|
}
|
|
403
448
|
|
|
404
|
-
function getEndOfWeek(timestamp, weekdays, today) {
|
|
405
|
-
|
|
406
|
-
if (!weekdays || !Array.isArray(weekdays)) return freezeTimestamp(end);
|
|
407
|
-
if (daysInMonth(end.year, end.month) === end.day || end.weekday === weekdays[weekdays.length - 1]) while (!weekdays.includes(Number(end.weekday))) end = prevDay(end);
|
|
408
|
-
end = findWeekday(end, weekdays[weekdays.length - 1], nextDay);
|
|
409
|
-
end = updateFormatted(end);
|
|
410
|
-
if (today) end = updateRelative(end, today, end.hasTime);
|
|
411
|
-
return end;
|
|
449
|
+
function getEndOfWeek(timestamp, weekdays, today, calendar = gregorianCalendar) {
|
|
450
|
+
return getCalendarEndOfWeek(timestamp, weekdays, calendar, today);
|
|
412
451
|
}
|
|
413
452
|
|
|
414
|
-
function getStartOfMonth(timestamp) {
|
|
415
|
-
|
|
416
|
-
start.day = 1;
|
|
417
|
-
start = updateFormatted(start);
|
|
418
|
-
return start;
|
|
453
|
+
function getStartOfMonth(timestamp, calendar = gregorianCalendar) {
|
|
454
|
+
return getCalendarStartOfMonth(timestamp, calendar);
|
|
419
455
|
}
|
|
420
456
|
|
|
421
|
-
function getEndOfMonth(timestamp) {
|
|
422
|
-
|
|
423
|
-
end.day = daysInMonth(end.year, end.month);
|
|
424
|
-
end = updateFormatted(end);
|
|
425
|
-
return end;
|
|
457
|
+
function getEndOfMonth(timestamp, calendar = gregorianCalendar) {
|
|
458
|
+
return getCalendarEndOfMonth(timestamp, calendar);
|
|
426
459
|
}
|
|
427
460
|
|
|
428
461
|
function parseTime(input) {
|
|
@@ -478,6 +511,20 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
478
511
|
return getEpochDay(timestamp, calendar);
|
|
479
512
|
}
|
|
480
513
|
|
|
514
|
+
function getCalendarDateIdentity(timestamp, calendar = gregorianCalendar) {
|
|
515
|
+
const native = toCalendarDateParts(timestamp);
|
|
516
|
+
const epochDay = calendar.toEpochDay(native);
|
|
517
|
+
const gregorian = gregorianCalendar.fromEpochDay(epochDay);
|
|
518
|
+
return Object.freeze({
|
|
519
|
+
calendarId: calendar.id,
|
|
520
|
+
nativeDate: formatCalendarDate(native),
|
|
521
|
+
native,
|
|
522
|
+
gregorianDate: formatCalendarDate(gregorian),
|
|
523
|
+
gregorian,
|
|
524
|
+
epochDay
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
|
|
481
528
|
function isValidCalendarDate(date, calendar = gregorianCalendar) {
|
|
482
529
|
if (date.year < 1) return false;
|
|
483
530
|
if (date.month < 1 || date.month > calendar.monthsInYear(date.year)) return false;
|
|
@@ -522,6 +569,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
522
569
|
});
|
|
523
570
|
}
|
|
524
571
|
|
|
572
|
+
function validateCalendarTimestamp(input, calendar = gregorianCalendar) {
|
|
573
|
+
return parseCalendarTimestamp(input, calendar) !== null;
|
|
574
|
+
}
|
|
575
|
+
|
|
525
576
|
function createCalendarTimestampFromEpochDay(epochDay, calendar = gregorianCalendar, options = {}) {
|
|
526
577
|
return createCalendarTimestamp(calendar.fromEpochDay(epochDay), calendar, options);
|
|
527
578
|
}
|
|
@@ -680,13 +731,20 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
680
731
|
}
|
|
681
732
|
let day = updateCalendarFormatted(current, calendar);
|
|
682
733
|
day = updateCalendarRelative(day, now, calendar);
|
|
683
|
-
day =
|
|
734
|
+
day = updateCalendarDisabled(day, disabledBefore, disabledAfter, disabledWeekdays, disabledDays, calendar);
|
|
684
735
|
days.push(day);
|
|
685
736
|
current = nextCalendarDay(current, calendar);
|
|
686
737
|
}
|
|
687
738
|
return days;
|
|
688
739
|
}
|
|
689
740
|
|
|
741
|
+
function isOutsideCalendarMonth(timestamp, reference, calendar = gregorianCalendar) {
|
|
742
|
+
const start = getCalendarStartOfMonth(reference, calendar);
|
|
743
|
+
const end = getCalendarEndOfMonth(reference, calendar);
|
|
744
|
+
const targetIdentifier = getCalendarDayIdentifier(timestamp, calendar);
|
|
745
|
+
return targetIdentifier < getCalendarDayIdentifier(start, calendar) || targetIdentifier > getCalendarDayIdentifier(end, calendar);
|
|
746
|
+
}
|
|
747
|
+
|
|
690
748
|
function getTimeIdentifier(timestamp) {
|
|
691
749
|
return (timestamp.hour ?? 0) * 100 + (timestamp.minute ?? 0);
|
|
692
750
|
}
|
|
@@ -705,10 +763,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
705
763
|
return utc2 - utc1;
|
|
706
764
|
}
|
|
707
765
|
|
|
708
|
-
function updateRelative(timestamp, now, time = false) {
|
|
766
|
+
function updateRelative(timestamp, now, time = false, calendar = gregorianCalendar) {
|
|
709
767
|
const ts = cloneTimestamp(timestamp);
|
|
710
|
-
let a =
|
|
711
|
-
let b =
|
|
768
|
+
let a = getCalendarDayIdentifier(now, calendar);
|
|
769
|
+
let b = getCalendarDayIdentifier(ts, calendar);
|
|
712
770
|
let current = a === b;
|
|
713
771
|
if (ts.hasTime && time && current) {
|
|
714
772
|
a = getTimeComparisonValue(now);
|
|
@@ -722,7 +780,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
722
780
|
return freezeTimestamp(ts);
|
|
723
781
|
}
|
|
724
782
|
|
|
725
|
-
function updateMinutes(timestamp, minutes, now = null) {
|
|
783
|
+
function updateMinutes(timestamp, minutes, now = null, calendar = gregorianCalendar) {
|
|
726
784
|
let ts = cloneTimestamp(timestamp);
|
|
727
785
|
ts.hasTime = true;
|
|
728
786
|
ts.hour = Math.floor(minutes / TIME_CONSTANTS.MINUTES_IN.HOUR);
|
|
@@ -730,25 +788,25 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
730
788
|
delete ts.second;
|
|
731
789
|
delete ts.millisecond;
|
|
732
790
|
ts.time = getTime(ts);
|
|
733
|
-
if (now) return updateRelative(ts, now, true);
|
|
791
|
+
if (now) return updateRelative(ts, now, true, calendar);
|
|
734
792
|
return freezeTimestamp(ts);
|
|
735
793
|
}
|
|
736
794
|
|
|
737
|
-
function updateWeekday(timestamp) {
|
|
795
|
+
function updateWeekday(timestamp, calendar = gregorianCalendar) {
|
|
738
796
|
const ts = cloneTimestamp(timestamp);
|
|
739
|
-
ts.weekday = getWeekday(ts);
|
|
797
|
+
ts.weekday = getWeekday(ts, calendar);
|
|
740
798
|
return freezeTimestamp(ts);
|
|
741
799
|
}
|
|
742
800
|
|
|
743
|
-
function updateDayOfYear(timestamp) {
|
|
801
|
+
function updateDayOfYear(timestamp, calendar = gregorianCalendar) {
|
|
744
802
|
const ts = cloneTimestamp(timestamp);
|
|
745
|
-
ts.doy = getDayOfYear(ts) || 0;
|
|
803
|
+
ts.doy = getDayOfYear(ts, calendar) || 0;
|
|
746
804
|
return freezeTimestamp(ts);
|
|
747
805
|
}
|
|
748
806
|
|
|
749
|
-
function updateWorkWeek(timestamp) {
|
|
807
|
+
function updateWorkWeek(timestamp, calendar = gregorianCalendar) {
|
|
750
808
|
const ts = cloneTimestamp(timestamp);
|
|
751
|
-
ts.workweek = getWorkWeek(ts);
|
|
809
|
+
ts.workweek = getWorkWeek(ts, calendar);
|
|
752
810
|
return freezeTimestamp(ts);
|
|
753
811
|
}
|
|
754
812
|
function isDisabledDayConfig(value) {
|
|
@@ -796,6 +854,34 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
796
854
|
const disabledDay = parseTimestamp(day);
|
|
797
855
|
return disabledDay !== null && getDayIdentifier(disabledDay) === target;
|
|
798
856
|
}
|
|
857
|
+
function parseCalendarDateIdentifier(value, calendar) {
|
|
858
|
+
const timestamp = parseCalendarTimestamp(value, calendar);
|
|
859
|
+
return timestamp === null ? null : getCalendarDayIdentifier(timestamp, calendar);
|
|
860
|
+
}
|
|
861
|
+
function isTimestampInCalendarDisabledDay(timestamp, day, calendar) {
|
|
862
|
+
const target = getCalendarDayIdentifier(timestamp, calendar);
|
|
863
|
+
if (Array.isArray(day) === true) {
|
|
864
|
+
if (day.length === 2 && day[0] && day[1]) {
|
|
865
|
+
const start = parseCalendarDateIdentifier(day[0], calendar);
|
|
866
|
+
const end = parseCalendarDateIdentifier(day[1], calendar);
|
|
867
|
+
return start !== null && end !== null && target >= Math.min(start, end) && target <= Math.max(start, end);
|
|
868
|
+
}
|
|
869
|
+
return day.some((date) => parseCalendarDateIdentifier(date, calendar) === target);
|
|
870
|
+
}
|
|
871
|
+
if (isDisabledDayConfig(day) === true) {
|
|
872
|
+
const date = day.date;
|
|
873
|
+
const startDate = day.from ?? day.start;
|
|
874
|
+
const endDate = day.to ?? day.end;
|
|
875
|
+
if (date !== void 0) return parseCalendarDateIdentifier(date, calendar) === target;
|
|
876
|
+
if (startDate !== void 0 && endDate !== void 0) {
|
|
877
|
+
const start = parseCalendarDateIdentifier(startDate, calendar);
|
|
878
|
+
const end = parseCalendarDateIdentifier(endDate, calendar);
|
|
879
|
+
return start !== null && end !== null && target >= Math.min(start, end) && target <= Math.max(start, end);
|
|
880
|
+
}
|
|
881
|
+
return false;
|
|
882
|
+
}
|
|
883
|
+
return parseCalendarDateIdentifier(day, calendar) === target;
|
|
884
|
+
}
|
|
799
885
|
|
|
800
886
|
function updateDisabled(timestamp, disabledBefore, disabledAfter, disabledWeekdays, disabledDays) {
|
|
801
887
|
let ts = cloneTimestamp(timestamp);
|
|
@@ -827,28 +913,138 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
827
913
|
return freezeTimestamp(ts);
|
|
828
914
|
}
|
|
829
915
|
|
|
830
|
-
function
|
|
916
|
+
function updateCalendarDisabled(timestamp, disabledBefore, disabledAfter, disabledWeekdays, disabledDays, calendar = gregorianCalendar) {
|
|
917
|
+
let ts = cloneTimestamp(timestamp);
|
|
918
|
+
const target = getCalendarDayIdentifier(ts, calendar);
|
|
919
|
+
if (disabledBefore !== void 0) {
|
|
920
|
+
const before = parseCalendarDateIdentifier(disabledBefore, calendar);
|
|
921
|
+
if (before !== null && target <= before) ts.disabled = true;
|
|
922
|
+
}
|
|
923
|
+
if (ts.disabled !== true && disabledAfter !== void 0) {
|
|
924
|
+
const after = parseCalendarDateIdentifier(disabledAfter, calendar);
|
|
925
|
+
if (after !== null && target >= after) ts.disabled = true;
|
|
926
|
+
}
|
|
927
|
+
if (ts.disabled !== true && Array.isArray(disabledWeekdays) && disabledWeekdays.length > 0) {
|
|
928
|
+
for (const weekday of disabledWeekdays) if (weekday === ts.weekday) {
|
|
929
|
+
ts.disabled = true;
|
|
930
|
+
break;
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
if (ts.disabled !== true && Array.isArray(disabledDays) && disabledDays.length > 0) {
|
|
934
|
+
for (const day of disabledDays) if (isTimestampInCalendarDisabledDay(ts, day, calendar) === true) {
|
|
935
|
+
ts = applyDisabledDayConfig(ts, isDisabledDayConfig(day) === true ? day : void 0);
|
|
936
|
+
break;
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
return freezeTimestamp(ts);
|
|
940
|
+
}
|
|
941
|
+
function isTimestampInCalendarDateCollection(timestamp, dates, calendar) {
|
|
942
|
+
if (dates === void 0) return false;
|
|
943
|
+
const target = getCalendarDayIdentifier(timestamp, calendar);
|
|
944
|
+
for (const date of dates) if (parseCalendarDateIdentifier(date, calendar) === target) return true;
|
|
945
|
+
return false;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
function getCalendarSelectionState(timestamp, options = {}, calendar = gregorianCalendar) {
|
|
949
|
+
const selectedDate = isTimestampInCalendarDateCollection(timestamp, options.selectedDates, calendar);
|
|
950
|
+
const target = getCalendarDayIdentifier(timestamp, calendar);
|
|
951
|
+
const rangeBoundaryDates = options.selectedStartEndDates ?? [];
|
|
952
|
+
let rangeFirst = false;
|
|
953
|
+
let range = false;
|
|
954
|
+
let rangeLast = false;
|
|
955
|
+
if (rangeBoundaryDates.length === 2 && rangeBoundaryDates[0] && rangeBoundaryDates[1]) {
|
|
956
|
+
const first = parseCalendarDateIdentifier(rangeBoundaryDates[0], calendar);
|
|
957
|
+
const last = parseCalendarDateIdentifier(rangeBoundaryDates[1], calendar);
|
|
958
|
+
if (first !== null && last !== null) {
|
|
959
|
+
const start = Math.min(first, last);
|
|
960
|
+
const end = Math.max(first, last);
|
|
961
|
+
rangeFirst = target === start;
|
|
962
|
+
rangeLast = target === end;
|
|
963
|
+
range = target > start && target < end;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
return Object.freeze({
|
|
967
|
+
selectedDate,
|
|
968
|
+
rangeFirst,
|
|
969
|
+
range,
|
|
970
|
+
rangeLast,
|
|
971
|
+
selected: selectedDate || rangeFirst || range || rangeLast
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
function getCalendarDateState(timestamp, options = {}, calendar = gregorianCalendar) {
|
|
976
|
+
const disabledTimestamp = updateCalendarDisabled(timestamp, options.disabledBefore, options.disabledAfter, options.disabledWeekdays, options.disabledDays, calendar);
|
|
977
|
+
const selection = getCalendarSelectionState(disabledTimestamp, options, calendar);
|
|
978
|
+
const outside = options.outside ?? (options.referenceMonth === void 0 ? false : isOutsideCalendarMonth(disabledTimestamp, options.referenceMonth, calendar));
|
|
979
|
+
return Object.freeze({
|
|
980
|
+
timestamp: disabledTimestamp,
|
|
981
|
+
identity: getCalendarDateIdentity(disabledTimestamp, calendar),
|
|
982
|
+
outside,
|
|
983
|
+
disabled: disabledTimestamp.disabled === true,
|
|
984
|
+
...selection
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
function createCalendarMonthView(timestamp, now, calendar = gregorianCalendar, options = {}) {
|
|
989
|
+
const weekdays = options.weekdays ?? [
|
|
990
|
+
0,
|
|
991
|
+
1,
|
|
992
|
+
2,
|
|
993
|
+
3,
|
|
994
|
+
4,
|
|
995
|
+
5,
|
|
996
|
+
6
|
|
997
|
+
];
|
|
998
|
+
const reference = updateCalendarFormatted(timestamp, calendar);
|
|
999
|
+
const start = getCalendarStartOfMonth(reference, calendar);
|
|
1000
|
+
const end = getCalendarEndOfMonth(reference, calendar);
|
|
1001
|
+
const visibleStart = getCalendarStartOfWeek(start, weekdays, calendar, now);
|
|
1002
|
+
const visibleEnd = getCalendarEndOfWeek(end, weekdays, calendar, now);
|
|
1003
|
+
const days = createCalendarDayList(visibleStart, visibleEnd, now, calendar, {
|
|
1004
|
+
weekdays,
|
|
1005
|
+
disabledBefore: options.disabledBefore,
|
|
1006
|
+
disabledAfter: options.disabledAfter,
|
|
1007
|
+
disabledWeekdays: options.disabledWeekdays,
|
|
1008
|
+
disabledDays: options.disabledDays,
|
|
1009
|
+
max: options.max ?? weekdays.length * 6,
|
|
1010
|
+
min: options.min ?? weekdays.length * 6
|
|
1011
|
+
}).map((day) => getCalendarDateState(day, {
|
|
1012
|
+
...options,
|
|
1013
|
+
referenceMonth: reference
|
|
1014
|
+
}, calendar));
|
|
1015
|
+
return Object.freeze({
|
|
1016
|
+
reference,
|
|
1017
|
+
start,
|
|
1018
|
+
end,
|
|
1019
|
+
visibleStart,
|
|
1020
|
+
visibleEnd,
|
|
1021
|
+
days
|
|
1022
|
+
});
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
function updateFormatted(timestamp, calendar = gregorianCalendar) {
|
|
831
1026
|
const ts = cloneTimestamp(timestamp);
|
|
832
1027
|
ts.hasTime = true;
|
|
833
1028
|
ts.time = getTime(ts);
|
|
834
1029
|
ts.date = getDate(ts);
|
|
835
|
-
ts.weekday = getWeekday(ts);
|
|
836
|
-
ts.doy = getDayOfYear(ts) || 0;
|
|
837
|
-
ts.workweek = getWorkWeek(ts);
|
|
1030
|
+
ts.weekday = getWeekday(ts, calendar);
|
|
1031
|
+
ts.doy = getDayOfYear(ts, calendar) || 0;
|
|
1032
|
+
ts.workweek = getWorkWeek(ts, calendar);
|
|
838
1033
|
return freezeTimestamp(ts);
|
|
839
1034
|
}
|
|
840
1035
|
|
|
841
|
-
function getDayOfYear(timestamp) {
|
|
1036
|
+
function getDayOfYear(timestamp, calendar = gregorianCalendar) {
|
|
842
1037
|
if (timestamp.year === 0) return;
|
|
843
|
-
return
|
|
1038
|
+
return calendar.getDayOfYear(toCalendarDateParts(timestamp));
|
|
844
1039
|
}
|
|
845
1040
|
|
|
846
|
-
function getWorkWeek(timestamp) {
|
|
1041
|
+
function getWorkWeek(timestamp, calendar = gregorianCalendar) {
|
|
847
1042
|
let ts = timestamp;
|
|
848
1043
|
if (ts.year === 0) {
|
|
849
|
-
const parsedToday =
|
|
1044
|
+
const parsedToday = parseCalendarTimestamp(today(calendar), calendar);
|
|
850
1045
|
if (parsedToday) ts = parsedToday;
|
|
851
1046
|
}
|
|
1047
|
+
if (calendar !== gregorianCalendar) return getCalendarWorkWeek(toCalendarDateParts(ts), calendar);
|
|
852
1048
|
const weekday = new Date(Date.UTC(ts.year, ts.month - 1, ts.day));
|
|
853
1049
|
const dayAdjustment = 4;
|
|
854
1050
|
weekday.setUTCDate(weekday.getUTCDate() - (weekday.getUTCDay() + 6) % 7 + dayAdjustment);
|
|
@@ -857,9 +1053,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
857
1053
|
return Math.ceil(((weekday.valueOf() - yearStart.valueOf()) / 864e5 + 1) / 7);
|
|
858
1054
|
}
|
|
859
1055
|
|
|
860
|
-
function getWeekday(timestamp) {
|
|
1056
|
+
function getWeekday(timestamp, calendar = gregorianCalendar) {
|
|
861
1057
|
let weekday = timestamp.weekday;
|
|
862
|
-
if (timestamp.hasDay) weekday =
|
|
1058
|
+
if (timestamp.hasDay) weekday = calendar.getWeekday(toCalendarDateParts(timestamp));
|
|
863
1059
|
return weekday ?? 0;
|
|
864
1060
|
}
|
|
865
1061
|
|
|
@@ -886,18 +1082,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
886
1082
|
return setTimeParts(timestamp, 23, 59, 59, 999);
|
|
887
1083
|
}
|
|
888
1084
|
|
|
889
|
-
function getStartOfYear(timestamp) {
|
|
890
|
-
|
|
891
|
-
ts.month = 1;
|
|
892
|
-
ts.day = 1;
|
|
893
|
-
return getStartOfDay(updateFormatted(ts));
|
|
1085
|
+
function getStartOfYear(timestamp, calendar = gregorianCalendar) {
|
|
1086
|
+
return getStartOfDay(getCalendarStartOfYear(timestamp, calendar));
|
|
894
1087
|
}
|
|
895
1088
|
|
|
896
|
-
function getEndOfYear(timestamp) {
|
|
897
|
-
|
|
898
|
-
ts.month = 12;
|
|
899
|
-
ts.day = daysInMonth(ts.year, 12);
|
|
900
|
-
return getEndOfDay(updateFormatted(ts));
|
|
1089
|
+
function getEndOfYear(timestamp, calendar = gregorianCalendar) {
|
|
1090
|
+
return getEndOfDay(getCalendarEndOfYear(timestamp, calendar));
|
|
901
1091
|
}
|
|
902
1092
|
|
|
903
1093
|
function getDate(timestamp) {
|
|
@@ -926,8 +1116,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
926
1116
|
4,
|
|
927
1117
|
5,
|
|
928
1118
|
6
|
|
929
|
-
]) {
|
|
930
|
-
return relativeDays(timestamp, mover, days, allowedWeekdays);
|
|
1119
|
+
], calendar = gregorianCalendar) {
|
|
1120
|
+
return relativeDays(timestamp, mover, days, allowedWeekdays, calendar);
|
|
931
1121
|
}
|
|
932
1122
|
|
|
933
1123
|
function relativeDays(timestamp, mover = nextDay, days = 1, allowedWeekdays = [
|
|
@@ -938,19 +1128,19 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
938
1128
|
4,
|
|
939
1129
|
5,
|
|
940
1130
|
6
|
|
941
|
-
]) {
|
|
1131
|
+
], calendar = gregorianCalendar) {
|
|
942
1132
|
let ts = copyTimestamp(timestamp);
|
|
943
1133
|
if (!allowedWeekdays.includes(Number(ts.weekday)) && ts.weekday === 0 && mover === nextDay) ++days;
|
|
944
1134
|
while (--days >= 0) {
|
|
945
|
-
ts = mover(ts);
|
|
1135
|
+
ts = mover(ts, calendar);
|
|
946
1136
|
if (allowedWeekdays.length < 7 && !allowedWeekdays.includes(Number(ts.weekday))) ++days;
|
|
947
1137
|
}
|
|
948
1138
|
return ts;
|
|
949
1139
|
}
|
|
950
1140
|
|
|
951
|
-
function findWeekday(timestamp, weekday, mover = nextDay, maxDays = 6) {
|
|
1141
|
+
function findWeekday(timestamp, weekday, mover = nextDay, maxDays = 6, calendar = gregorianCalendar) {
|
|
952
1142
|
let ts = copyTimestamp(timestamp);
|
|
953
|
-
while (ts.weekday !== weekday && --maxDays >= 0) ts = mover(ts);
|
|
1143
|
+
while (ts.weekday !== weekday && --maxDays >= 0) ts = mover(ts, calendar);
|
|
954
1144
|
return ts;
|
|
955
1145
|
}
|
|
956
1146
|
|
|
@@ -962,7 +1152,16 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
962
1152
|
4,
|
|
963
1153
|
5,
|
|
964
1154
|
6
|
|
965
|
-
], disabledBefore = void 0, disabledAfter = void 0, disabledWeekdays = [], disabledDays = [], max = 42, min = 0) {
|
|
1155
|
+
], disabledBefore = void 0, disabledAfter = void 0, disabledWeekdays = [], disabledDays = [], max = 42, min = 0, calendar = gregorianCalendar) {
|
|
1156
|
+
if (calendar !== gregorianCalendar) return createCalendarDayList(start, end, now, calendar, {
|
|
1157
|
+
weekdays,
|
|
1158
|
+
disabledBefore,
|
|
1159
|
+
disabledAfter,
|
|
1160
|
+
disabledWeekdays,
|
|
1161
|
+
disabledDays,
|
|
1162
|
+
max,
|
|
1163
|
+
min
|
|
1164
|
+
});
|
|
966
1165
|
const begin = getDayIdentifier(start);
|
|
967
1166
|
const stop = getDayIdentifier(end);
|
|
968
1167
|
const days = [];
|
|
@@ -1193,7 +1392,34 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
1193
1392
|
return start >= first && start <= last || end >= first && end <= last || first >= start && end >= last;
|
|
1194
1393
|
}
|
|
1195
1394
|
|
|
1196
|
-
function
|
|
1395
|
+
function addToCalendarDateTime(timestamp, options, calendar) {
|
|
1396
|
+
let ts = updateCalendarFormatted(timestamp, calendar);
|
|
1397
|
+
if (options.year) ts = addCalendarYears(ts, options.year, calendar);
|
|
1398
|
+
if (options.month) ts = addCalendarMonths(ts, options.month, calendar);
|
|
1399
|
+
if (options.day) ts = addCalendarDays(ts, options.day, calendar);
|
|
1400
|
+
if (options.hour !== void 0 || options.minute !== void 0 || options.second !== void 0 || options.millisecond !== void 0) {
|
|
1401
|
+
const totalMilliseconds = (ts.hour + (options.hour ?? 0)) * MILLISECONDS_IN_HOUR + (ts.minute + (options.minute ?? 0)) * MILLISECONDS_IN_MINUTE + ((ts.second ?? 0) + (options.second ?? 0)) * MILLISECONDS_IN_SECOND + ((ts.millisecond ?? 0) + (options.millisecond ?? 0));
|
|
1402
|
+
const dayOffset = Math.floor(totalMilliseconds / MILLISECONDS_IN_DAY);
|
|
1403
|
+
let timeMilliseconds = totalMilliseconds % MILLISECONDS_IN_DAY;
|
|
1404
|
+
if (timeMilliseconds < 0) timeMilliseconds += MILLISECONDS_IN_DAY;
|
|
1405
|
+
if (dayOffset !== 0) ts = addCalendarDays(ts, dayOffset, calendar);
|
|
1406
|
+
const next = cloneTimestamp(ts);
|
|
1407
|
+
next.hasTime = true;
|
|
1408
|
+
next.hour = Math.floor(timeMilliseconds / MILLISECONDS_IN_HOUR);
|
|
1409
|
+
timeMilliseconds %= MILLISECONDS_IN_HOUR;
|
|
1410
|
+
next.minute = Math.floor(timeMilliseconds / MILLISECONDS_IN_MINUTE);
|
|
1411
|
+
timeMilliseconds %= MILLISECONDS_IN_MINUTE;
|
|
1412
|
+
next.second = Math.floor(timeMilliseconds / MILLISECONDS_IN_SECOND);
|
|
1413
|
+
next.millisecond = timeMilliseconds % MILLISECONDS_IN_SECOND;
|
|
1414
|
+
if (next.second === 0 && timestamp.second === void 0 && options.second === void 0) delete next.second;
|
|
1415
|
+
if (next.millisecond === 0 && timestamp.millisecond === void 0 && options.millisecond === void 0) delete next.millisecond;
|
|
1416
|
+
ts = next;
|
|
1417
|
+
}
|
|
1418
|
+
return updateCalendarFormatted(ts, calendar);
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
function addToDate(timestamp, options, calendar = gregorianCalendar) {
|
|
1422
|
+
if (calendar !== gregorianCalendar) return addToCalendarDateTime(timestamp, options, calendar);
|
|
1197
1423
|
const ts = cloneTimestamp(timestamp);
|
|
1198
1424
|
if (options.year) ts.year += options.year;
|
|
1199
1425
|
if (options.month) ts.month += options.month;
|
|
@@ -1205,7 +1431,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
1205
1431
|
return updateFormatted(normalizeTimestamp(ts));
|
|
1206
1432
|
}
|
|
1207
1433
|
|
|
1208
|
-
function addToDateClamped(timestamp, options) {
|
|
1434
|
+
function addToDateClamped(timestamp, options, calendar = gregorianCalendar) {
|
|
1435
|
+
if (calendar !== gregorianCalendar) return addToCalendarDateTime(timestamp, options, calendar);
|
|
1209
1436
|
const ts = cloneTimestamp(timestamp);
|
|
1210
1437
|
if (options.year || options.month) {
|
|
1211
1438
|
const target = normalizeYearMonth(ts.year + (options.year ?? 0), ts.month + (options.month ?? 0));
|
|
@@ -1399,10 +1626,57 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
1399
1626
|
return monthFormatter;
|
|
1400
1627
|
}
|
|
1401
1628
|
|
|
1629
|
+
function getCalendarMonthFormatter(calendar = gregorianCalendar) {
|
|
1630
|
+
const options = {
|
|
1631
|
+
long: {
|
|
1632
|
+
timeZone: "UTC",
|
|
1633
|
+
month: "long"
|
|
1634
|
+
},
|
|
1635
|
+
short: {
|
|
1636
|
+
timeZone: "UTC",
|
|
1637
|
+
month: "short"
|
|
1638
|
+
},
|
|
1639
|
+
narrow: {
|
|
1640
|
+
timeZone: "UTC",
|
|
1641
|
+
month: "narrow"
|
|
1642
|
+
}
|
|
1643
|
+
};
|
|
1644
|
+
const fallbackFormatter = (month) => Number.isFinite(month) && month >= 1 ? `Month ${month}` : "";
|
|
1645
|
+
if (typeof Intl === "undefined" || typeof Intl.DateTimeFormat === "undefined") return fallbackFormatter;
|
|
1646
|
+
return (month, type = "long", locale, year = 1) => {
|
|
1647
|
+
const calendarMonth = Math.trunc(month);
|
|
1648
|
+
const calendarYear = Math.trunc(year);
|
|
1649
|
+
const date = {
|
|
1650
|
+
year: calendarYear,
|
|
1651
|
+
month: calendarMonth,
|
|
1652
|
+
day: 1
|
|
1653
|
+
};
|
|
1654
|
+
if (Number.isFinite(calendarMonth) === false || Number.isFinite(calendarYear) === false || isValidCalendarDate(date, calendar) === false) return "";
|
|
1655
|
+
try {
|
|
1656
|
+
const resolvedOptions = resolveIntlNameFormat(options, type);
|
|
1657
|
+
const formatterOptions = calendar.intlCalendar === void 0 || resolvedOptions.calendar !== void 0 ? resolvedOptions : {
|
|
1658
|
+
...resolvedOptions,
|
|
1659
|
+
calendar: calendar.intlCalendar
|
|
1660
|
+
};
|
|
1661
|
+
const gregorianDate = gregorianCalendar.fromEpochDay(calendar.toEpochDay(date));
|
|
1662
|
+
const nativeDate = new Date(Date.UTC(gregorianDate.year, gregorianDate.month - 1, gregorianDate.day));
|
|
1663
|
+
return new Intl.DateTimeFormat(locale || void 0, formatterOptions).format(nativeDate);
|
|
1664
|
+
} catch (e) {
|
|
1665
|
+
if (e instanceof Error) console.error(`Intl.DateTimeFormat: ${e.message} -> calendar month: ${calendarMonth}`);
|
|
1666
|
+
return fallbackFormatter(calendarMonth);
|
|
1667
|
+
}
|
|
1668
|
+
};
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1402
1671
|
function getMonthNames(type, locale) {
|
|
1403
1672
|
const monthFormatter = getMonthFormatter();
|
|
1404
1673
|
return [...Array(12).keys()].map((month) => monthFormatter(month, type, locale));
|
|
1405
1674
|
}
|
|
1675
|
+
|
|
1676
|
+
function getCalendarMonthNames(calendar = gregorianCalendar, type = "long", locale, year = 1) {
|
|
1677
|
+
const monthFormatter = getCalendarMonthFormatter(calendar);
|
|
1678
|
+
return [...Array(calendar.monthsInYear(year)).keys()].map((month) => monthFormatter(month + 1, type, locale, year));
|
|
1679
|
+
}
|
|
1406
1680
|
|
|
1407
1681
|
exports.DAYS_IN_MONTH = DAYS_IN_MONTH;
|
|
1408
1682
|
exports.DAYS_IN_MONTH_LEAP = DAYS_IN_MONTH_LEAP;
|
|
@@ -1443,6 +1717,7 @@ exports.compareTimestamps = compareTimestamps;
|
|
|
1443
1717
|
exports.copyTimestamp = copyTimestamp;
|
|
1444
1718
|
exports.createCalendarDayList = createCalendarDayList;
|
|
1445
1719
|
exports.createCalendarLocaleFormatterUTC = createCalendarLocaleFormatterUTC;
|
|
1720
|
+
exports.createCalendarMonthView = createCalendarMonthView;
|
|
1446
1721
|
exports.createCalendarTimestamp = createCalendarTimestamp;
|
|
1447
1722
|
exports.createCalendarTimestampFromEpochDay = createCalendarTimestampFromEpochDay;
|
|
1448
1723
|
exports.createDayList = createDayList;
|
|
@@ -1463,13 +1738,21 @@ exports.formatCalendarDate = formatCalendarDate;
|
|
|
1463
1738
|
exports.formatDuration = formatDuration;
|
|
1464
1739
|
exports.fromUnixMilliseconds = fromUnixMilliseconds;
|
|
1465
1740
|
exports.fromUnixSeconds = fromUnixSeconds;
|
|
1741
|
+
exports.getCalendarDateIdentity = getCalendarDateIdentity;
|
|
1742
|
+
exports.getCalendarDateState = getCalendarDateState;
|
|
1466
1743
|
exports.getCalendarDayIdentifier = getCalendarDayIdentifier;
|
|
1744
|
+
exports.getCalendarDirection = getCalendarDirection;
|
|
1467
1745
|
exports.getCalendarEndOfMonth = getCalendarEndOfMonth;
|
|
1468
1746
|
exports.getCalendarEndOfWeek = getCalendarEndOfWeek;
|
|
1469
1747
|
exports.getCalendarEndOfYear = getCalendarEndOfYear;
|
|
1748
|
+
exports.getCalendarLocale = getCalendarLocale;
|
|
1749
|
+
exports.getCalendarMonthFormatter = getCalendarMonthFormatter;
|
|
1750
|
+
exports.getCalendarMonthNames = getCalendarMonthNames;
|
|
1751
|
+
exports.getCalendarSelectionState = getCalendarSelectionState;
|
|
1470
1752
|
exports.getCalendarStartOfMonth = getCalendarStartOfMonth;
|
|
1471
1753
|
exports.getCalendarStartOfWeek = getCalendarStartOfWeek;
|
|
1472
1754
|
exports.getCalendarStartOfYear = getCalendarStartOfYear;
|
|
1755
|
+
exports.getCalendarWeekdays = getCalendarWeekdays;
|
|
1473
1756
|
exports.getDate = getDate;
|
|
1474
1757
|
exports.getDateObject = getDateObject;
|
|
1475
1758
|
exports.getDateTime = getDateTime;
|
|
@@ -1496,7 +1779,9 @@ exports.getWorkWeek = getWorkWeek;
|
|
|
1496
1779
|
exports.gregorianCalendar = gregorianCalendar;
|
|
1497
1780
|
exports.intersectRanges = intersectRanges;
|
|
1498
1781
|
exports.isBetweenDates = isBetweenDates;
|
|
1782
|
+
exports.isCalendarRTL = isCalendarRTL;
|
|
1499
1783
|
exports.isLeapYear = isLeapYear;
|
|
1784
|
+
exports.isOutsideCalendarMonth = isOutsideCalendarMonth;
|
|
1500
1785
|
exports.isOverlappingDates = isOverlappingDates;
|
|
1501
1786
|
exports.isRangeOverlapping = isRangeOverlapping;
|
|
1502
1787
|
exports.isTimestampInRange = isTimestampInRange;
|
|
@@ -1534,6 +1819,7 @@ exports.toUnixMilliseconds = toUnixMilliseconds;
|
|
|
1534
1819
|
exports.toUnixSeconds = toUnixSeconds;
|
|
1535
1820
|
exports.today = today;
|
|
1536
1821
|
exports.todayUTC = todayUTC;
|
|
1822
|
+
exports.updateCalendarDisabled = updateCalendarDisabled;
|
|
1537
1823
|
exports.updateCalendarFormatted = updateCalendarFormatted;
|
|
1538
1824
|
exports.updateCalendarRelative = updateCalendarRelative;
|
|
1539
1825
|
exports.updateDayOfYear = updateDayOfYear;
|
|
@@ -1543,6 +1829,7 @@ exports.updateMinutes = updateMinutes;
|
|
|
1543
1829
|
exports.updateRelative = updateRelative;
|
|
1544
1830
|
exports.updateWeekday = updateWeekday;
|
|
1545
1831
|
exports.updateWorkWeek = updateWorkWeek;
|
|
1832
|
+
exports.validateCalendarTimestamp = validateCalendarTimestamp;
|
|
1546
1833
|
exports.validateNumber = validateNumber;
|
|
1547
1834
|
exports.validateTimestamp = validateTimestamp;
|
|
1548
1835
|
exports.weeksBetween = weeksBetween;
|