@zag-js/date-utils 0.0.0-dev-20230116072304 → 0.0.0-dev-20230201190914
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assertion.js +1 -1
- package/dist/assertion.mjs +1 -1
- package/dist/{chunk-RJCAPB5F.mjs → chunk-55BYHK5B.mjs} +1 -2
- package/dist/{chunk-CAV5WKCZ.mjs → chunk-ETRHBIGD.mjs} +2 -2
- package/dist/{chunk-URPTPFL3.mjs → chunk-GLQDJRSE.mjs} +2 -2
- package/dist/{chunk-6EJZROXM.mjs → chunk-H4CAPQVS.mjs} +1 -1
- package/dist/{chunk-HUBKWHIN.mjs → chunk-MGRIF22W.mjs} +1 -2
- package/dist/{chunk-GKU5M6QU.mjs → chunk-NXMEZINO.mjs} +2 -2
- package/dist/{chunk-DETLHDDR.mjs → chunk-SQCHVCXH.mjs} +2 -2
- package/dist/{chunk-BBE325GQ.mjs → chunk-TSOWYV6W.mjs} +4 -4
- package/dist/{chunk-HL7SOSTW.mjs → chunk-U6WRBS5P.mjs} +1 -1
- package/dist/{chunk-BRQVXAVZ.mjs → chunk-VTFZA34K.mjs} +1 -1
- package/dist/format-selected-date.js +3 -3
- package/dist/format-selected-date.mjs +2 -2
- package/dist/format-visible-range.js +5 -5
- package/dist/format-visible-range.mjs +2 -2
- package/dist/get-formatter.js +4 -4
- package/dist/get-formatter.mjs +1 -1
- package/dist/get-month-dates.js +1 -2
- package/dist/get-month-dates.mjs +1 -1
- package/dist/index.js +12 -14
- package/dist/index.mjs +10 -10
- package/dist/pagination.mjs +2 -2
- package/dist/segment-constants.js +1 -2
- package/dist/segment-constants.mjs +1 -1
- package/dist/segment-limit.js +1 -1
- package/dist/segment-limit.mjs +1 -1
- package/dist/segment-mutation.js +2 -2
- package/dist/segment-mutation.mjs +1 -1
- package/dist/segment-parts.js +1 -1
- package/dist/segment-parts.mjs +3 -3
- package/package.json +1 -1
package/dist/assertion.js
CHANGED
|
@@ -47,7 +47,7 @@ function isDateUnavailable(date, isUnavailable, minValue, maxValue) {
|
|
|
47
47
|
if (!date) {
|
|
48
48
|
return false;
|
|
49
49
|
}
|
|
50
|
-
if (isUnavailable
|
|
50
|
+
if (isUnavailable?.(date)) {
|
|
51
51
|
return true;
|
|
52
52
|
}
|
|
53
53
|
return isDateInvalid(date, minValue, maxValue);
|
package/dist/assertion.mjs
CHANGED
|
@@ -21,8 +21,7 @@ function isSegmentEditable(segment) {
|
|
|
21
21
|
return EDITABLE_SEGMENTS[segment];
|
|
22
22
|
}
|
|
23
23
|
function getSegmentPageStep(segment) {
|
|
24
|
-
|
|
25
|
-
return (_a = SEGMENT_PAGE_STEP[segment]) != null ? _a : 1;
|
|
24
|
+
return SEGMENT_PAGE_STEP[segment] ?? 1;
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
export {
|
|
@@ -19,7 +19,7 @@ function addSegment(date, part, amount, options) {
|
|
|
19
19
|
case "second":
|
|
20
20
|
return date.cycle(part, amount, {
|
|
21
21
|
round: part !== "hour",
|
|
22
|
-
hourCycle:
|
|
22
|
+
hourCycle: options?.hour12 ? 12 : 24
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -42,7 +42,7 @@ function setSegment(date, part, value, options) {
|
|
|
42
42
|
return isPM === wasPM ? date : date.set({ hour: wasPM ? hours - 12 : hours + 12 });
|
|
43
43
|
}
|
|
44
44
|
case "hour":
|
|
45
|
-
if (options
|
|
45
|
+
if (options?.hour12) {
|
|
46
46
|
let hours = date.hour;
|
|
47
47
|
let wasPM = hours >= 12;
|
|
48
48
|
if (!wasPM && value === 12) {
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
getDateFormatter,
|
|
6
6
|
getMonthFormatter
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TSOWYV6W.mjs";
|
|
8
8
|
|
|
9
9
|
// src/format-visible-range.ts
|
|
10
10
|
import { endOfMonth, isSameDay, startOfMonth } from "@internationalized/date";
|
|
@@ -12,7 +12,7 @@ function formatVisibleRange(startDate, endDate, getFormatter, isAria, timeZone)
|
|
|
12
12
|
if (!startDate)
|
|
13
13
|
return "";
|
|
14
14
|
let start = startDate;
|
|
15
|
-
let end = endDate
|
|
15
|
+
let end = endDate ?? startDate;
|
|
16
16
|
let monthFormatter = getMonthFormatter(start, end, getFormatter, timeZone);
|
|
17
17
|
let dateFormatter = getDateFormatter(start, end, getFormatter, timeZone);
|
|
18
18
|
if (!isSameDay(start, startOfMonth(start))) {
|
|
@@ -16,7 +16,7 @@ function isDateUnavailable(date, isUnavailable, minValue, maxValue) {
|
|
|
16
16
|
if (!date) {
|
|
17
17
|
return false;
|
|
18
18
|
}
|
|
19
|
-
if (isUnavailable
|
|
19
|
+
if (isUnavailable?.(date)) {
|
|
20
20
|
return true;
|
|
21
21
|
}
|
|
22
22
|
return isDateInvalid(date, minValue, maxValue);
|
|
@@ -5,9 +5,8 @@ import {
|
|
|
5
5
|
// src/get-month-dates.ts
|
|
6
6
|
import { getWeeksInMonth } from "@internationalized/date";
|
|
7
7
|
function getMonthDates(startDate, duration, locale) {
|
|
8
|
-
var _a;
|
|
9
8
|
let weeksInMonth = getWeeksInMonth(startDate, locale);
|
|
10
|
-
let numOfWeeks =
|
|
9
|
+
let numOfWeeks = duration.weeks ?? weeksInMonth;
|
|
11
10
|
let weekArr = [...new Array(numOfWeeks).keys()];
|
|
12
11
|
return weekArr.map((index) => {
|
|
13
12
|
return getDatesInWeek(index, startDate, locale);
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-HKHGJ6WS.mjs";
|
|
4
4
|
import {
|
|
5
5
|
getDateFormatter
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TSOWYV6W.mjs";
|
|
7
7
|
|
|
8
8
|
// src/format-selected-date.ts
|
|
9
9
|
import { isSameDay } from "@internationalized/date";
|
|
10
10
|
function formatSelectedDate(startDate, endDate, getFormatter, isSelectingRange, timeZone) {
|
|
11
11
|
let start = startDate;
|
|
12
|
-
let end = endDate
|
|
12
|
+
let end = endDate ?? startDate;
|
|
13
13
|
let formatter = getDateFormatter(start, end, getFormatter, timeZone);
|
|
14
14
|
if (isSelectingRange || start == null || end == null) {
|
|
15
15
|
return "";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getSegmentLimits
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-U6WRBS5P.mjs";
|
|
4
4
|
import {
|
|
5
5
|
getTodayPlaceholderDate
|
|
6
6
|
} from "./chunk-DZM5JUL2.mjs";
|
|
7
7
|
import {
|
|
8
8
|
isSegmentEditable
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-55BYHK5B.mjs";
|
|
10
10
|
|
|
11
11
|
// src/segment-parts.ts
|
|
12
12
|
function getAllSegments(segments) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// src/get-formatter.ts
|
|
2
2
|
function getEraFormat(date) {
|
|
3
|
-
return
|
|
3
|
+
return date?.calendar.identifier === "gregory" && date.era === "BC" ? "short" : void 0;
|
|
4
4
|
}
|
|
5
5
|
function getDateFormatter(startDate, endDate, getDateFormatter2, timeZone) {
|
|
6
6
|
let start = startDate;
|
|
7
|
-
let end = endDate
|
|
7
|
+
let end = endDate ?? startDate;
|
|
8
8
|
let era = getEraFormat(start) || getEraFormat(end);
|
|
9
9
|
return getDateFormatter2({
|
|
10
10
|
weekday: "long",
|
|
@@ -17,13 +17,13 @@ function getDateFormatter(startDate, endDate, getDateFormatter2, timeZone) {
|
|
|
17
17
|
}
|
|
18
18
|
function getMonthFormatter(startDate, endDate, getDateFormatter2, timeZone) {
|
|
19
19
|
let start = startDate;
|
|
20
|
-
let end = endDate
|
|
20
|
+
let end = endDate ?? startDate;
|
|
21
21
|
let era = getEraFormat(start) || getEraFormat(end);
|
|
22
22
|
return getDateFormatter2({
|
|
23
23
|
month: "long",
|
|
24
24
|
year: "numeric",
|
|
25
25
|
era,
|
|
26
|
-
calendar: start
|
|
26
|
+
calendar: start?.calendar.identifier,
|
|
27
27
|
timeZone
|
|
28
28
|
});
|
|
29
29
|
}
|
|
@@ -51,11 +51,11 @@ function formatRange(startDate, endDate, formatter, toString, timeZone) {
|
|
|
51
51
|
|
|
52
52
|
// src/get-formatter.ts
|
|
53
53
|
function getEraFormat(date) {
|
|
54
|
-
return
|
|
54
|
+
return date?.calendar.identifier === "gregory" && date.era === "BC" ? "short" : void 0;
|
|
55
55
|
}
|
|
56
56
|
function getDateFormatter(startDate, endDate, getDateFormatter2, timeZone) {
|
|
57
57
|
let start = startDate;
|
|
58
|
-
let end = endDate
|
|
58
|
+
let end = endDate ?? startDate;
|
|
59
59
|
let era = getEraFormat(start) || getEraFormat(end);
|
|
60
60
|
return getDateFormatter2({
|
|
61
61
|
weekday: "long",
|
|
@@ -70,7 +70,7 @@ function getDateFormatter(startDate, endDate, getDateFormatter2, timeZone) {
|
|
|
70
70
|
// src/format-selected-date.ts
|
|
71
71
|
function formatSelectedDate(startDate, endDate, getFormatter, isSelectingRange, timeZone) {
|
|
72
72
|
let start = startDate;
|
|
73
|
-
let end = endDate
|
|
73
|
+
let end = endDate ?? startDate;
|
|
74
74
|
let formatter = getDateFormatter(start, end, getFormatter, timeZone);
|
|
75
75
|
if (isSelectingRange || start == null || end == null) {
|
|
76
76
|
return "";
|
|
@@ -51,11 +51,11 @@ function formatRange(startDate, endDate, formatter, toString, timeZone) {
|
|
|
51
51
|
|
|
52
52
|
// src/get-formatter.ts
|
|
53
53
|
function getEraFormat(date) {
|
|
54
|
-
return
|
|
54
|
+
return date?.calendar.identifier === "gregory" && date.era === "BC" ? "short" : void 0;
|
|
55
55
|
}
|
|
56
56
|
function getDateFormatter(startDate, endDate, getDateFormatter2, timeZone) {
|
|
57
57
|
let start = startDate;
|
|
58
|
-
let end = endDate
|
|
58
|
+
let end = endDate ?? startDate;
|
|
59
59
|
let era = getEraFormat(start) || getEraFormat(end);
|
|
60
60
|
return getDateFormatter2({
|
|
61
61
|
weekday: "long",
|
|
@@ -68,13 +68,13 @@ function getDateFormatter(startDate, endDate, getDateFormatter2, timeZone) {
|
|
|
68
68
|
}
|
|
69
69
|
function getMonthFormatter(startDate, endDate, getDateFormatter2, timeZone) {
|
|
70
70
|
let start = startDate;
|
|
71
|
-
let end = endDate
|
|
71
|
+
let end = endDate ?? startDate;
|
|
72
72
|
let era = getEraFormat(start) || getEraFormat(end);
|
|
73
73
|
return getDateFormatter2({
|
|
74
74
|
month: "long",
|
|
75
75
|
year: "numeric",
|
|
76
76
|
era,
|
|
77
|
-
calendar: start
|
|
77
|
+
calendar: start?.calendar.identifier,
|
|
78
78
|
timeZone
|
|
79
79
|
});
|
|
80
80
|
}
|
|
@@ -84,7 +84,7 @@ function formatVisibleRange(startDate, endDate, getFormatter, isAria, timeZone)
|
|
|
84
84
|
if (!startDate)
|
|
85
85
|
return "";
|
|
86
86
|
let start = startDate;
|
|
87
|
-
let end = endDate
|
|
87
|
+
let end = endDate ?? startDate;
|
|
88
88
|
let monthFormatter = getMonthFormatter(start, end, getFormatter, timeZone);
|
|
89
89
|
let dateFormatter = getDateFormatter(start, end, getFormatter, timeZone);
|
|
90
90
|
if (!(0, import_date.isSameDay)(start, (0, import_date.startOfMonth)(start))) {
|
package/dist/get-formatter.js
CHANGED
|
@@ -25,11 +25,11 @@ __export(get_formatter_exports, {
|
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(get_formatter_exports);
|
|
27
27
|
function getEraFormat(date) {
|
|
28
|
-
return
|
|
28
|
+
return date?.calendar.identifier === "gregory" && date.era === "BC" ? "short" : void 0;
|
|
29
29
|
}
|
|
30
30
|
function getDateFormatter(startDate, endDate, getDateFormatter2, timeZone) {
|
|
31
31
|
let start = startDate;
|
|
32
|
-
let end = endDate
|
|
32
|
+
let end = endDate ?? startDate;
|
|
33
33
|
let era = getEraFormat(start) || getEraFormat(end);
|
|
34
34
|
return getDateFormatter2({
|
|
35
35
|
weekday: "long",
|
|
@@ -42,13 +42,13 @@ function getDateFormatter(startDate, endDate, getDateFormatter2, timeZone) {
|
|
|
42
42
|
}
|
|
43
43
|
function getMonthFormatter(startDate, endDate, getDateFormatter2, timeZone) {
|
|
44
44
|
let start = startDate;
|
|
45
|
-
let end = endDate
|
|
45
|
+
let end = endDate ?? startDate;
|
|
46
46
|
let era = getEraFormat(start) || getEraFormat(end);
|
|
47
47
|
return getDateFormatter2({
|
|
48
48
|
month: "long",
|
|
49
49
|
year: "numeric",
|
|
50
50
|
era,
|
|
51
|
-
calendar: start
|
|
51
|
+
calendar: start?.calendar.identifier,
|
|
52
52
|
timeZone
|
|
53
53
|
});
|
|
54
54
|
}
|
package/dist/get-formatter.mjs
CHANGED
package/dist/get-month-dates.js
CHANGED
|
@@ -51,9 +51,8 @@ function getDatesInWeek(weekIndex, fromDate, locale) {
|
|
|
51
51
|
|
|
52
52
|
// src/get-month-dates.ts
|
|
53
53
|
function getMonthDates(startDate, duration, locale) {
|
|
54
|
-
var _a;
|
|
55
54
|
let weeksInMonth = (0, import_date2.getWeeksInMonth)(startDate, locale);
|
|
56
|
-
let numOfWeeks =
|
|
55
|
+
let numOfWeeks = duration.weeks ?? weeksInMonth;
|
|
57
56
|
let weekArr = [...new Array(numOfWeeks).keys()];
|
|
58
57
|
return weekArr.map((index) => {
|
|
59
58
|
return getDatesInWeek(index, startDate, locale);
|
package/dist/get-month-dates.mjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -171,7 +171,7 @@ function isDateUnavailable(date, isUnavailable, minValue, maxValue) {
|
|
|
171
171
|
if (!date) {
|
|
172
172
|
return false;
|
|
173
173
|
}
|
|
174
|
-
if (isUnavailable
|
|
174
|
+
if (isUnavailable?.(date)) {
|
|
175
175
|
return true;
|
|
176
176
|
}
|
|
177
177
|
return isDateInvalid(date, minValue, maxValue);
|
|
@@ -235,11 +235,11 @@ var import_date3 = require("@internationalized/date");
|
|
|
235
235
|
|
|
236
236
|
// src/get-formatter.ts
|
|
237
237
|
function getEraFormat(date) {
|
|
238
|
-
return
|
|
238
|
+
return date?.calendar.identifier === "gregory" && date.era === "BC" ? "short" : void 0;
|
|
239
239
|
}
|
|
240
240
|
function getDateFormatter(startDate, endDate, getDateFormatter2, timeZone) {
|
|
241
241
|
let start = startDate;
|
|
242
|
-
let end = endDate
|
|
242
|
+
let end = endDate ?? startDate;
|
|
243
243
|
let era = getEraFormat(start) || getEraFormat(end);
|
|
244
244
|
return getDateFormatter2({
|
|
245
245
|
weekday: "long",
|
|
@@ -252,13 +252,13 @@ function getDateFormatter(startDate, endDate, getDateFormatter2, timeZone) {
|
|
|
252
252
|
}
|
|
253
253
|
function getMonthFormatter(startDate, endDate, getDateFormatter2, timeZone) {
|
|
254
254
|
let start = startDate;
|
|
255
|
-
let end = endDate
|
|
255
|
+
let end = endDate ?? startDate;
|
|
256
256
|
let era = getEraFormat(start) || getEraFormat(end);
|
|
257
257
|
return getDateFormatter2({
|
|
258
258
|
month: "long",
|
|
259
259
|
year: "numeric",
|
|
260
260
|
era,
|
|
261
|
-
calendar: start
|
|
261
|
+
calendar: start?.calendar.identifier,
|
|
262
262
|
timeZone
|
|
263
263
|
});
|
|
264
264
|
}
|
|
@@ -266,7 +266,7 @@ function getMonthFormatter(startDate, endDate, getDateFormatter2, timeZone) {
|
|
|
266
266
|
// src/format-selected-date.ts
|
|
267
267
|
function formatSelectedDate(startDate, endDate, getFormatter, isSelectingRange, timeZone) {
|
|
268
268
|
let start = startDate;
|
|
269
|
-
let end = endDate
|
|
269
|
+
let end = endDate ?? startDate;
|
|
270
270
|
let formatter = getDateFormatter(start, end, getFormatter, timeZone);
|
|
271
271
|
if (isSelectingRange || start == null || end == null) {
|
|
272
272
|
return "";
|
|
@@ -283,7 +283,7 @@ function formatVisibleRange(startDate, endDate, getFormatter, isAria, timeZone)
|
|
|
283
283
|
if (!startDate)
|
|
284
284
|
return "";
|
|
285
285
|
let start = startDate;
|
|
286
|
-
let end = endDate
|
|
286
|
+
let end = endDate ?? startDate;
|
|
287
287
|
let monthFormatter = getMonthFormatter(start, end, getFormatter, timeZone);
|
|
288
288
|
let dateFormatter = getDateFormatter(start, end, getFormatter, timeZone);
|
|
289
289
|
if (!(0, import_date4.isSameDay)(start, (0, import_date4.startOfMonth)(start))) {
|
|
@@ -333,9 +333,8 @@ function getWeekDates(fromDate, timeZone, locale) {
|
|
|
333
333
|
|
|
334
334
|
// src/get-month-dates.ts
|
|
335
335
|
function getMonthDates(startDate, duration, locale) {
|
|
336
|
-
var _a;
|
|
337
336
|
let weeksInMonth = (0, import_date6.getWeeksInMonth)(startDate, locale);
|
|
338
|
-
let numOfWeeks =
|
|
337
|
+
let numOfWeeks = duration.weeks ?? weeksInMonth;
|
|
339
338
|
let weekArr = [...new Array(numOfWeeks).keys()];
|
|
340
339
|
return weekArr.map((index) => {
|
|
341
340
|
return getDatesInWeek(index, startDate, locale);
|
|
@@ -604,8 +603,7 @@ function isSegmentEditable(segment) {
|
|
|
604
603
|
return EDITABLE_SEGMENTS[segment];
|
|
605
604
|
}
|
|
606
605
|
function getSegmentPageStep(segment) {
|
|
607
|
-
|
|
608
|
-
return (_a = SEGMENT_PAGE_STEP[segment]) != null ? _a : 1;
|
|
606
|
+
return SEGMENT_PAGE_STEP[segment] ?? 1;
|
|
609
607
|
}
|
|
610
608
|
|
|
611
609
|
// src/segment-limit.ts
|
|
@@ -648,7 +646,7 @@ function getSegmentLimits(date, type, options) {
|
|
|
648
646
|
max: 12
|
|
649
647
|
};
|
|
650
648
|
case "hour":
|
|
651
|
-
if (options
|
|
649
|
+
if (options?.hour12) {
|
|
652
650
|
let isPM = date.hour >= 12;
|
|
653
651
|
return {
|
|
654
652
|
value: date.hour,
|
|
@@ -703,7 +701,7 @@ function addSegment(date, part, amount, options) {
|
|
|
703
701
|
case "second":
|
|
704
702
|
return date.cycle(part, amount, {
|
|
705
703
|
round: part !== "hour",
|
|
706
|
-
hourCycle:
|
|
704
|
+
hourCycle: options?.hour12 ? 12 : 24
|
|
707
705
|
});
|
|
708
706
|
}
|
|
709
707
|
}
|
|
@@ -726,7 +724,7 @@ function setSegment(date, part, value, options) {
|
|
|
726
724
|
return isPM === wasPM ? date : date.set({ hour: wasPM ? hours - 12 : hours + 12 });
|
|
727
725
|
}
|
|
728
726
|
case "hour":
|
|
729
|
-
if (options
|
|
727
|
+
if (options?.hour12) {
|
|
730
728
|
let hours = date.hour;
|
|
731
729
|
let wasPM = hours >= 12;
|
|
732
730
|
if (!wasPM && value === 12) {
|
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addSegment,
|
|
3
3
|
setSegment
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ETRHBIGD.mjs";
|
|
5
5
|
import {
|
|
6
6
|
getAllSegments,
|
|
7
7
|
getSegments
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-SQCHVCXH.mjs";
|
|
9
9
|
import {
|
|
10
10
|
getSegmentLimits
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-U6WRBS5P.mjs";
|
|
12
12
|
import {
|
|
13
13
|
getMonthDates
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-MGRIF22W.mjs";
|
|
15
15
|
import {
|
|
16
16
|
getDatesInWeek,
|
|
17
17
|
getWeekDates
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
getPreviousSection,
|
|
40
40
|
getSectionEnd,
|
|
41
41
|
getSectionStart
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-VTFZA34K.mjs";
|
|
43
43
|
import {
|
|
44
44
|
createPlaceholderDate,
|
|
45
45
|
getTodayPlaceholderDate
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
SEGMENT_PAGE_STEP,
|
|
49
49
|
getSegmentPageStep,
|
|
50
50
|
isSegmentEditable
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-55BYHK5B.mjs";
|
|
52
52
|
import {
|
|
53
53
|
alignDate,
|
|
54
54
|
alignStartDate
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
isNextVisibleRangeInvalid,
|
|
63
63
|
isPreviousVisibleRangeInvalid,
|
|
64
64
|
isTodayDate
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-H4CAPQVS.mjs";
|
|
66
66
|
import {
|
|
67
67
|
alignCenter,
|
|
68
68
|
alignEnd,
|
|
@@ -76,14 +76,14 @@ import {
|
|
|
76
76
|
} from "./chunk-ZSLC7OI2.mjs";
|
|
77
77
|
import {
|
|
78
78
|
formatSelectedDate
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-NXMEZINO.mjs";
|
|
80
80
|
import {
|
|
81
81
|
formatVisibleRange
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-GLQDJRSE.mjs";
|
|
83
83
|
import {
|
|
84
84
|
formatRange
|
|
85
85
|
} from "./chunk-HKHGJ6WS.mjs";
|
|
86
|
-
import "./chunk-
|
|
86
|
+
import "./chunk-TSOWYV6W.mjs";
|
|
87
87
|
export {
|
|
88
88
|
SEGMENT_PAGE_STEP,
|
|
89
89
|
addSegment,
|
package/dist/pagination.mjs
CHANGED
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
getPreviousSection,
|
|
9
9
|
getSectionEnd,
|
|
10
10
|
getSectionStart
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-VTFZA34K.mjs";
|
|
12
|
+
import "./chunk-H4CAPQVS.mjs";
|
|
13
13
|
import "./chunk-MGPXEJO4.mjs";
|
|
14
14
|
import "./chunk-ZSLC7OI2.mjs";
|
|
15
15
|
export {
|
|
@@ -47,8 +47,7 @@ function isSegmentEditable(segment) {
|
|
|
47
47
|
return EDITABLE_SEGMENTS[segment];
|
|
48
48
|
}
|
|
49
49
|
function getSegmentPageStep(segment) {
|
|
50
|
-
|
|
51
|
-
return (_a = SEGMENT_PAGE_STEP[segment]) != null ? _a : 1;
|
|
50
|
+
return SEGMENT_PAGE_STEP[segment] ?? 1;
|
|
52
51
|
}
|
|
53
52
|
// Annotate the CommonJS export names for ESM import in node:
|
|
54
53
|
0 && (module.exports = {
|
package/dist/segment-limit.js
CHANGED
package/dist/segment-limit.mjs
CHANGED
package/dist/segment-mutation.js
CHANGED
|
@@ -44,7 +44,7 @@ function addSegment(date, part, amount, options) {
|
|
|
44
44
|
case "second":
|
|
45
45
|
return date.cycle(part, amount, {
|
|
46
46
|
round: part !== "hour",
|
|
47
|
-
hourCycle:
|
|
47
|
+
hourCycle: options?.hour12 ? 12 : 24
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -67,7 +67,7 @@ function setSegment(date, part, value, options) {
|
|
|
67
67
|
return isPM === wasPM ? date : date.set({ hour: wasPM ? hours - 12 : hours + 12 });
|
|
68
68
|
}
|
|
69
69
|
case "hour":
|
|
70
|
-
if (options
|
|
70
|
+
if (options?.hour12) {
|
|
71
71
|
let hours = date.hour;
|
|
72
72
|
let wasPM = hours >= 12;
|
|
73
73
|
if (!wasPM && value === 12) {
|
package/dist/segment-parts.js
CHANGED
package/dist/segment-parts.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getAllSegments,
|
|
3
3
|
getSegments
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-SQCHVCXH.mjs";
|
|
5
|
+
import "./chunk-U6WRBS5P.mjs";
|
|
6
6
|
import "./chunk-DZM5JUL2.mjs";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-55BYHK5B.mjs";
|
|
8
8
|
export {
|
|
9
9
|
getAllSegments,
|
|
10
10
|
getSegments
|