@uxf/datepicker 16.13.1 → 16.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.
Files changed (94) hide show
  1. package/contexts/date-picker-context.d.ts +1 -1
  2. package/contexts/date-picker-context.js +2 -2
  3. package/contexts/date-range-picker-context.d.ts +1 -1
  4. package/contexts/date-range-picker-context.js +2 -2
  5. package/contexts/time-picker-context.js +2 -2
  6. package/hooks/use-date-picker-navigation.d.ts +5 -5
  7. package/hooks/use-date-picker-navigation.js +22 -22
  8. package/hooks/use-date-picker-navigation.test.js +7 -7
  9. package/hooks/use-date-picker.d.ts +2 -2
  10. package/hooks/use-date-picker.js +32 -32
  11. package/hooks/use-date-picker.test.js +7 -7
  12. package/hooks/use-date-range-picker.d.ts +2 -2
  13. package/hooks/use-date-range-picker.js +62 -62
  14. package/hooks/use-date-range-picker.test.js +16 -16
  15. package/hooks/use-day.d.ts +2 -2
  16. package/hooks/use-day.js +22 -22
  17. package/hooks/use-day.test.js +12 -12
  18. package/hooks/use-decade.d.ts +2 -2
  19. package/hooks/use-decade.js +8 -8
  20. package/hooks/use-decade.test.js +6 -6
  21. package/hooks/use-hour.d.ts +1 -1
  22. package/hooks/use-hour.test.js +3 -3
  23. package/hooks/use-hours.test.js +3 -3
  24. package/hooks/use-minute.d.ts +2 -2
  25. package/hooks/use-minute.test.js +3 -3
  26. package/hooks/use-minutes.test.js +3 -3
  27. package/hooks/use-month.d.ts +2 -2
  28. package/hooks/use-month.js +10 -10
  29. package/hooks/use-month.test.js +7 -7
  30. package/hooks/use-time-picker.d.ts +5 -5
  31. package/hooks/use-time-picker.test.js +5 -5
  32. package/hooks/use-year.d.ts +2 -2
  33. package/hooks/use-year.js +7 -7
  34. package/hooks/use-year.test.js +6 -6
  35. package/package.json +5 -5
  36. package/utils/can-select-range.d.ts +5 -5
  37. package/utils/can-select-range.js +8 -8
  38. package/utils/can-select-range.test.js +10 -10
  39. package/utils/date-string.d.ts +1 -1
  40. package/utils/date-string.js +6 -6
  41. package/utils/date-string.test.js +33 -33
  42. package/utils/dayjs-utils.d.ts +1 -1
  43. package/utils/dayjs-utils.js +8 -41
  44. package/utils/dst-robustness.test.js +74 -74
  45. package/utils/get-current-year-month-and-date.d.ts +1 -1
  46. package/utils/get-current-year-month-and-date.js +2 -2
  47. package/utils/get-current-year-month-and-date.test.js +3 -3
  48. package/utils/get-date-intervals.test.js +15 -15
  49. package/utils/get-date-invervals.js +4 -4
  50. package/utils/get-date-month-and-year.d.ts +1 -1
  51. package/utils/get-date-month-and-year.js +4 -4
  52. package/utils/get-date-month-and-year.test.js +3 -3
  53. package/utils/get-days.d.ts +4 -4
  54. package/utils/get-days.js +17 -17
  55. package/utils/get-days.test.js +5 -5
  56. package/utils/get-each.d.ts +1 -1
  57. package/utils/get-each.js +5 -5
  58. package/utils/get-each.test.js +11 -11
  59. package/utils/get-first-active-month.d.ts +1 -1
  60. package/utils/get-first-active-month.js +2 -2
  61. package/utils/get-first-active-month.test.js +5 -5
  62. package/utils/get-initial-months.d.ts +1 -1
  63. package/utils/get-initial-months.js +6 -6
  64. package/utils/get-initial-months.test.js +5 -5
  65. package/utils/get-months.d.ts +1 -1
  66. package/utils/get-months.js +9 -9
  67. package/utils/get-months.test.js +4 -4
  68. package/utils/get-next-active-month.d.ts +1 -1
  69. package/utils/get-next-active-month.js +6 -6
  70. package/utils/get-next-active-month.test.js +9 -9
  71. package/utils/get-weekday-labels.d.ts +1 -1
  72. package/utils/get-weekday-labels.js +6 -6
  73. package/utils/get-weekday-labels.test.d.ts +1 -1
  74. package/utils/get-weekday-labels.test.js +8 -8
  75. package/utils/get-years.d.ts +1 -1
  76. package/utils/get-years.js +6 -6
  77. package/utils/get-years.test.js +5 -5
  78. package/utils/is-date-blocked.d.ts +5 -5
  79. package/utils/is-date-blocked.js +5 -5
  80. package/utils/is-date-blocked.test.js +16 -16
  81. package/utils/is-date-hovered.d.ts +5 -5
  82. package/utils/is-date-hovered.js +7 -7
  83. package/utils/is-date-hovered.test.js +9 -9
  84. package/utils/is-date-inside-range.d.ts +1 -1
  85. package/utils/is-date-selected.test.js +13 -13
  86. package/utils/is-end-date.d.ts +1 -1
  87. package/utils/is-end-date.test.js +10 -10
  88. package/utils/is-first-or-last-selected-date.d.ts +1 -1
  89. package/utils/is-first-or-last-selected-date.test.js +10 -10
  90. package/utils/is-in-unavailable-dates.d.ts +1 -1
  91. package/utils/is-in-unavailable-dates.test.js +9 -9
  92. package/utils/is-start-date.d.ts +1 -1
  93. package/utils/is-start-date.test.js +10 -10
  94. package/utils/types.d.ts +2 -2
@@ -10,57 +10,57 @@
10
10
  * npm run test:tz:tokyo -w @uxf/datepicker
11
11
  */
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- const can_select_range_1 = require("./can-select-range");
14
- const date_string_1 = require("./date-string");
15
- const get_current_year_month_and_date_1 = require("./get-current-year-month-and-date");
16
- const get_days_1 = require("./get-days");
17
- const get_weekday_labels_1 = require("./get-weekday-labels");
18
- const get_years_1 = require("./get-years");
19
- const is_date_blocked_1 = require("./is-date-blocked");
20
- const is_date_hovered_1 = require("./is-date-hovered");
21
- const is_date_inside_range_1 = require("./is-date-inside-range");
22
- const is_end_date_1 = require("./is-end-date");
23
- const is_first_or_last_selected_date_1 = require("./is-first-or-last-selected-date");
24
- const is_in_unavailable_dates_1 = require("./is-in-unavailable-dates");
25
- const is_start_date_1 = require("./is-start-date");
13
+ const can_select_range_ts_1 = require("./can-select-range.js");
14
+ const date_string_ts_1 = require("./date-string.js");
15
+ const get_current_year_month_and_date_ts_1 = require("./get-current-year-month-and-date.js");
16
+ const get_days_ts_1 = require("./get-days.js");
17
+ const get_weekday_labels_ts_1 = require("./get-weekday-labels.js");
18
+ const get_years_ts_1 = require("./get-years.js");
19
+ const is_date_blocked_ts_1 = require("./is-date-blocked.js");
20
+ const is_date_hovered_ts_1 = require("./is-date-hovered.js");
21
+ const is_date_inside_range_ts_1 = require("./is-date-inside-range.js");
22
+ const is_end_date_ts_1 = require("./is-end-date.js");
23
+ const is_first_or_last_selected_date_ts_1 = require("./is-first-or-last-selected-date.js");
24
+ const is_in_unavailable_dates_ts_1 = require("./is-in-unavailable-dates.js");
25
+ const is_start_date_ts_1 = require("./is-start-date.js");
26
26
  // Oct 25 2026 = DST fall-back in Europe/Prague (25h day, clocks go back)
27
27
  // Mar 29 2026 = DST spring-forward in Europe/Prague (23h day, clocks go forward)
28
28
  // Asia/Tokyo = UTC+9, no DST — local midnight is UTC previous-day 15:00 (extreme offset)
29
29
  describe("toDateString: local constructor vs ISO string are equivalent (any timezone)", () => {
30
30
  test("DST fall-back day: new Date(2026, 9, 25) === new Date('2026-10-25')", () => {
31
31
  // new Date(2026, 9, 25) = local midnight — different UTC timestamp than ISO string in UTC+ zones
32
- expect((0, date_string_1.toDateString)(new Date(2026, 9, 25))).toBe("2026-10-25");
33
- expect((0, date_string_1.toDateString)(new Date("2026-10-25"))).toBe("2026-10-25");
34
- expect((0, date_string_1.toDateString)(new Date(2026, 9, 25))).toBe((0, date_string_1.toDateString)(new Date("2026-10-25")));
32
+ expect((0, date_string_ts_1.toDateString)(new Date(2026, 9, 25))).toBe("2026-10-25");
33
+ expect((0, date_string_ts_1.toDateString)(new Date("2026-10-25"))).toBe("2026-10-25");
34
+ expect((0, date_string_ts_1.toDateString)(new Date(2026, 9, 25))).toBe((0, date_string_ts_1.toDateString)(new Date("2026-10-25")));
35
35
  });
36
36
  test("DST spring-forward day: new Date(2026, 2, 29) === new Date('2026-03-29')", () => {
37
- expect((0, date_string_1.toDateString)(new Date(2026, 2, 29))).toBe("2026-03-29");
38
- expect((0, date_string_1.toDateString)(new Date(2026, 2, 29))).toBe((0, date_string_1.toDateString)(new Date("2026-03-29")));
37
+ expect((0, date_string_ts_1.toDateString)(new Date(2026, 2, 29))).toBe("2026-03-29");
38
+ expect((0, date_string_ts_1.toDateString)(new Date(2026, 2, 29))).toBe((0, date_string_ts_1.toDateString)(new Date("2026-03-29")));
39
39
  });
40
40
  test("year-end: new Date(2025, 11, 31) === new Date('2025-12-31')", () => {
41
- expect((0, date_string_1.toDateString)(new Date(2025, 11, 31))).toBe("2025-12-31");
42
- expect((0, date_string_1.toDateString)(new Date(2025, 11, 31))).toBe((0, date_string_1.toDateString)(new Date("2025-12-31")));
41
+ expect((0, date_string_ts_1.toDateString)(new Date(2025, 11, 31))).toBe("2025-12-31");
42
+ expect((0, date_string_ts_1.toDateString)(new Date(2025, 11, 31))).toBe((0, date_string_ts_1.toDateString)(new Date("2025-12-31")));
43
43
  });
44
44
  test("year-start: new Date(2026, 0, 1) === new Date('2026-01-01')", () => {
45
- expect((0, date_string_1.toDateString)(new Date(2026, 0, 1))).toBe("2026-01-01");
46
- expect((0, date_string_1.toDateString)(new Date(2026, 0, 1))).toBe((0, date_string_1.toDateString)(new Date("2026-01-01")));
45
+ expect((0, date_string_ts_1.toDateString)(new Date(2026, 0, 1))).toBe("2026-01-01");
46
+ expect((0, date_string_ts_1.toDateString)(new Date(2026, 0, 1))).toBe((0, date_string_ts_1.toDateString)(new Date("2026-01-01")));
47
47
  });
48
48
  });
49
49
  describe("DST fall-back Oct 25 2026 (Europe/Prague)", () => {
50
50
  test("isStartDate: date on DST boundary matches", () => {
51
- expect((0, is_start_date_1.isStartDate)("2026-10-25", "2026-10-25")).toBe(true);
52
- expect((0, is_start_date_1.isStartDate)("2026-10-24", "2026-10-25")).toBe(false);
53
- expect((0, is_start_date_1.isStartDate)("2026-10-26", "2026-10-25")).toBe(false);
51
+ expect((0, is_start_date_ts_1.isStartDate)("2026-10-25", "2026-10-25")).toBe(true);
52
+ expect((0, is_start_date_ts_1.isStartDate)("2026-10-24", "2026-10-25")).toBe(false);
53
+ expect((0, is_start_date_ts_1.isStartDate)("2026-10-26", "2026-10-25")).toBe(false);
54
54
  });
55
55
  test("isDateInsideRange: date on DST fall-back boundary is inside range", () => {
56
- expect((0, is_date_inside_range_1.isDateInsideRange)("2026-10-25", "2026-10-24", "2026-10-26")).toBe(true);
56
+ expect((0, is_date_inside_range_ts_1.isDateInsideRange)("2026-10-25", "2026-10-24", "2026-10-26")).toBe(true);
57
57
  });
58
58
  test("isInUnavailableDates: date on DST boundary found in list", () => {
59
- expect((0, is_in_unavailable_dates_1.isInUnavailableDates)(["2026-10-25"], "2026-10-25")).toBe(true);
60
- expect((0, is_in_unavailable_dates_1.isInUnavailableDates)(["2026-10-24"], "2026-10-25")).toBe(false);
59
+ expect((0, is_in_unavailable_dates_ts_1.isInUnavailableDates)(["2026-10-25"], "2026-10-25")).toBe(true);
60
+ expect((0, is_in_unavailable_dates_ts_1.isInUnavailableDates)(["2026-10-24"], "2026-10-25")).toBe(false);
61
61
  });
62
62
  test("canSelectRange: 2-day range across DST fall-back is valid", () => {
63
- expect((0, can_select_range_1.canSelectRange)({
63
+ expect((0, can_select_range_ts_1.canSelectRange)({
64
64
  startDate: "2026-10-25",
65
65
  endDate: "2026-10-26",
66
66
  minBookingDays: 2,
@@ -71,7 +71,7 @@ describe("DST fall-back Oct 25 2026 (Europe/Prague)", () => {
71
71
  })).toBe(true);
72
72
  });
73
73
  test("isDateBlocked: date on DST boundary not blocked when minBookingDate is same day", () => {
74
- expect((0, is_date_blocked_1.isDateBlocked)({
74
+ expect((0, is_date_blocked_ts_1.isDateBlocked)({
75
75
  date: "2026-10-25",
76
76
  startDate: null,
77
77
  endDate: null,
@@ -79,15 +79,15 @@ describe("DST fall-back Oct 25 2026 (Europe/Prague)", () => {
79
79
  })).toBe(false);
80
80
  });
81
81
  test("isEndDate: date on DST boundary matches endDate", () => {
82
- expect((0, is_end_date_1.isEndDate)("2026-10-25", "2026-10-25")).toBe(true);
83
- expect((0, is_end_date_1.isEndDate)("2026-10-24", "2026-10-25")).toBe(false);
82
+ expect((0, is_end_date_ts_1.isEndDate)("2026-10-25", "2026-10-25")).toBe(true);
83
+ expect((0, is_end_date_ts_1.isEndDate)("2026-10-24", "2026-10-25")).toBe(false);
84
84
  });
85
85
  test("isFirstOrLastSelectedDate: DST boundary date matches start or end", () => {
86
- expect((0, is_first_or_last_selected_date_1.isFirstOrLastSelectedDate)("2026-10-25", "2026-10-25", "2026-10-28")).toBe(true);
87
- expect((0, is_first_or_last_selected_date_1.isFirstOrLastSelectedDate)("2026-10-28", "2026-10-25", "2026-10-28")).toBe(true);
86
+ expect((0, is_first_or_last_selected_date_ts_1.isFirstOrLastSelectedDate)("2026-10-25", "2026-10-25", "2026-10-28")).toBe(true);
87
+ expect((0, is_first_or_last_selected_date_ts_1.isFirstOrLastSelectedDate)("2026-10-28", "2026-10-25", "2026-10-28")).toBe(true);
88
88
  });
89
89
  test("isDateBlocked: date on DST boundary not blocked when maxBookingDate is same day", () => {
90
- expect((0, is_date_blocked_1.isDateBlocked)({
90
+ expect((0, is_date_blocked_ts_1.isDateBlocked)({
91
91
  date: "2026-10-25",
92
92
  startDate: null,
93
93
  endDate: null,
@@ -98,7 +98,7 @@ describe("DST fall-back Oct 25 2026 (Europe/Prague)", () => {
98
98
  });
99
99
  describe("DST spring-forward Mar 29 2026 (Europe/Prague)", () => {
100
100
  test("canSelectRange: 2-day range across DST spring-forward is valid", () => {
101
- expect((0, can_select_range_1.canSelectRange)({
101
+ expect((0, can_select_range_ts_1.canSelectRange)({
102
102
  startDate: "2026-03-29",
103
103
  endDate: "2026-03-30",
104
104
  minBookingDays: 2,
@@ -109,28 +109,28 @@ describe("DST spring-forward Mar 29 2026 (Europe/Prague)", () => {
109
109
  })).toBe(true);
110
110
  });
111
111
  test("isDateInsideRange: date on spring-forward boundary is inside range", () => {
112
- expect((0, is_date_inside_range_1.isDateInsideRange)("2026-03-29", "2026-03-28", "2026-03-30")).toBe(true);
112
+ expect((0, is_date_inside_range_ts_1.isDateInsideRange)("2026-03-29", "2026-03-28", "2026-03-30")).toBe(true);
113
113
  });
114
114
  });
115
115
  describe("UTC+9 (Asia/Tokyo, no DST) — year-end boundary Dec 31 2025 / Jan 1 2026", () => {
116
116
  test("isStartDate: year-end date matches", () => {
117
- expect((0, is_start_date_1.isStartDate)("2025-12-31", "2025-12-31")).toBe(true);
118
- expect((0, is_start_date_1.isStartDate)("2026-01-01", "2025-12-31")).toBe(false);
117
+ expect((0, is_start_date_ts_1.isStartDate)("2025-12-31", "2025-12-31")).toBe(true);
118
+ expect((0, is_start_date_ts_1.isStartDate)("2026-01-01", "2025-12-31")).toBe(false);
119
119
  });
120
120
  test("isEndDate: New Year's Day matches", () => {
121
- expect((0, is_end_date_1.isEndDate)("2026-01-01", "2026-01-01")).toBe(true);
122
- expect((0, is_end_date_1.isEndDate)("2025-12-31", "2026-01-01")).toBe(false);
121
+ expect((0, is_end_date_ts_1.isEndDate)("2026-01-01", "2026-01-01")).toBe(true);
122
+ expect((0, is_end_date_ts_1.isEndDate)("2025-12-31", "2026-01-01")).toBe(false);
123
123
  });
124
124
  test("isDateInsideRange: date on year-end boundary is inside range", () => {
125
- expect((0, is_date_inside_range_1.isDateInsideRange)("2025-12-31", "2025-12-30", "2026-01-01")).toBe(true);
126
- expect((0, is_date_inside_range_1.isDateInsideRange)("2026-01-01", "2025-12-31", "2026-01-02")).toBe(true);
125
+ expect((0, is_date_inside_range_ts_1.isDateInsideRange)("2025-12-31", "2025-12-30", "2026-01-01")).toBe(true);
126
+ expect((0, is_date_inside_range_ts_1.isDateInsideRange)("2026-01-01", "2025-12-31", "2026-01-02")).toBe(true);
127
127
  });
128
128
  test("isInUnavailableDates: year-end date found in list", () => {
129
- expect((0, is_in_unavailable_dates_1.isInUnavailableDates)(["2025-12-31"], "2025-12-31")).toBe(true);
130
- expect((0, is_in_unavailable_dates_1.isInUnavailableDates)(["2025-12-31"], "2026-01-01")).toBe(false);
129
+ expect((0, is_in_unavailable_dates_ts_1.isInUnavailableDates)(["2025-12-31"], "2025-12-31")).toBe(true);
130
+ expect((0, is_in_unavailable_dates_ts_1.isInUnavailableDates)(["2025-12-31"], "2026-01-01")).toBe(false);
131
131
  });
132
132
  test("canSelectRange: 2-day range spanning year boundary is valid", () => {
133
- expect((0, can_select_range_1.canSelectRange)({
133
+ expect((0, can_select_range_ts_1.canSelectRange)({
134
134
  startDate: "2025-12-31",
135
135
  endDate: "2026-01-01",
136
136
  minBookingDays: 2,
@@ -141,7 +141,7 @@ describe("UTC+9 (Asia/Tokyo, no DST) — year-end boundary Dec 31 2025 / Jan 1 2
141
141
  })).toBe(true);
142
142
  });
143
143
  test("canSelectRange: startDate on minBookingDate at year boundary is valid", () => {
144
- expect((0, can_select_range_1.canSelectRange)({
144
+ expect((0, can_select_range_ts_1.canSelectRange)({
145
145
  startDate: "2026-01-01",
146
146
  endDate: null,
147
147
  minBookingDays: 1,
@@ -152,7 +152,7 @@ describe("UTC+9 (Asia/Tokyo, no DST) — year-end boundary Dec 31 2025 / Jan 1 2
152
152
  })).toBe(true);
153
153
  });
154
154
  test("canSelectRange: endDate within maxBookingDate at year boundary is valid", () => {
155
- expect((0, can_select_range_1.canSelectRange)({
155
+ expect((0, can_select_range_ts_1.canSelectRange)({
156
156
  startDate: "2025-12-30",
157
157
  endDate: "2025-12-31",
158
158
  minBookingDays: 2,
@@ -163,7 +163,7 @@ describe("UTC+9 (Asia/Tokyo, no DST) — year-end boundary Dec 31 2025 / Jan 1 2
163
163
  })).toBe(true);
164
164
  });
165
165
  test("isDateBlocked: Dec 31 not blocked when minBookingDate is Dec 31", () => {
166
- expect((0, is_date_blocked_1.isDateBlocked)({
166
+ expect((0, is_date_blocked_ts_1.isDateBlocked)({
167
167
  date: "2025-12-31",
168
168
  startDate: null,
169
169
  endDate: null,
@@ -171,7 +171,7 @@ describe("UTC+9 (Asia/Tokyo, no DST) — year-end boundary Dec 31 2025 / Jan 1 2
171
171
  })).toBe(false);
172
172
  });
173
173
  test("isDateBlocked: Jan 1 not blocked when maxBookingDate is Jan 1", () => {
174
- expect((0, is_date_blocked_1.isDateBlocked)({
174
+ expect((0, is_date_blocked_ts_1.isDateBlocked)({
175
175
  date: "2026-01-01",
176
176
  startDate: null,
177
177
  endDate: null,
@@ -179,7 +179,7 @@ describe("UTC+9 (Asia/Tokyo, no DST) — year-end boundary Dec 31 2025 / Jan 1 2
179
179
  })).toBe(false);
180
180
  });
181
181
  test("isDateBlocked: Dec 30 blocked when minBookingDate is Dec 31", () => {
182
- expect((0, is_date_blocked_1.isDateBlocked)({
182
+ expect((0, is_date_blocked_ts_1.isDateBlocked)({
183
183
  date: "2025-12-30",
184
184
  startDate: null,
185
185
  endDate: null,
@@ -187,7 +187,7 @@ describe("UTC+9 (Asia/Tokyo, no DST) — year-end boundary Dec 31 2025 / Jan 1 2
187
187
  })).toBe(true);
188
188
  });
189
189
  test("isDateBlocked: Jan 2 blocked when maxBookingDate is Jan 1", () => {
190
- expect((0, is_date_blocked_1.isDateBlocked)({
190
+ expect((0, is_date_blocked_ts_1.isDateBlocked)({
191
191
  date: "2026-01-02",
192
192
  startDate: null,
193
193
  endDate: null,
@@ -195,12 +195,12 @@ describe("UTC+9 (Asia/Tokyo, no DST) — year-end boundary Dec 31 2025 / Jan 1 2
195
195
  })).toBe(true);
196
196
  });
197
197
  test("isFirstOrLastSelectedDate: year-end and new year match start/end", () => {
198
- expect((0, is_first_or_last_selected_date_1.isFirstOrLastSelectedDate)("2025-12-31", "2025-12-31", "2026-01-03")).toBe(true);
199
- expect((0, is_first_or_last_selected_date_1.isFirstOrLastSelectedDate)("2026-01-03", "2025-12-31", "2026-01-03")).toBe(true);
200
- expect((0, is_first_or_last_selected_date_1.isFirstOrLastSelectedDate)("2026-01-01", "2025-12-31", "2026-01-03")).toBe(false);
198
+ expect((0, is_first_or_last_selected_date_ts_1.isFirstOrLastSelectedDate)("2025-12-31", "2025-12-31", "2026-01-03")).toBe(true);
199
+ expect((0, is_first_or_last_selected_date_ts_1.isFirstOrLastSelectedDate)("2026-01-03", "2025-12-31", "2026-01-03")).toBe(true);
200
+ expect((0, is_first_or_last_selected_date_ts_1.isFirstOrLastSelectedDate)("2026-01-01", "2025-12-31", "2026-01-03")).toBe(false);
201
201
  });
202
202
  test("isDateHovered: date between startDate and hoveredDate highlighted across year boundary", () => {
203
- expect((0, is_date_hovered_1.isDateHovered)({
203
+ expect((0, is_date_hovered_ts_1.isDateHovered)({
204
204
  date: "2025-12-31",
205
205
  startDate: "2025-12-29",
206
206
  endDate: null,
@@ -221,26 +221,26 @@ describe("getDays: month boundaries correct in UTC+ timezone", () => {
221
221
  // 2026-04-30T23:59:59.999Z which local-methods read as 2026-05-01 →
222
222
  // monthEndStr becomes "2026-05-01", so May 1 ends up in the current-month slice.
223
223
  test("April 2026 calendar has exactly 35 days (5 weeks, firstDayOfWeek=1)", () => {
224
- const days = (0, get_days_1.getDays)({ year: 2026, month: 3, firstDayOfWeek: 1 });
224
+ const days = (0, get_days_ts_1.getDays)({ year: 2026, month: 3, firstDayOfWeek: 1 });
225
225
  expect(days).toHaveLength(35);
226
226
  });
227
227
  test("last current-month day in April 2026 is April 30", () => {
228
- const days = (0, get_days_1.getDays)({ year: 2026, month: 3, firstDayOfWeek: 1 });
228
+ const days = (0, get_days_ts_1.getDays)({ year: 2026, month: 3, firstDayOfWeek: 1 });
229
229
  const currentMonthDays = days.filter((d) => d.currentMonth);
230
230
  expect(currentMonthDays).toHaveLength(30);
231
231
  const last = currentMonthDays[currentMonthDays.length - 1];
232
- expect((0, date_string_1.toDateString)(last.date)).toBe("2026-04-30");
232
+ expect((0, date_string_ts_1.toDateString)(last.date)).toBe("2026-04-30");
233
233
  });
234
234
  test("May 1 appears as overflow (currentMonth: false) in April 2026 calendar", () => {
235
- const days = (0, get_days_1.getDays)({ year: 2026, month: 3, firstDayOfWeek: 1 });
236
- const may1 = days.find((d) => (0, date_string_1.toDateString)(d.date) === "2026-05-01");
235
+ const days = (0, get_days_ts_1.getDays)({ year: 2026, month: 3, firstDayOfWeek: 1 });
236
+ const may1 = days.find((d) => (0, date_string_ts_1.toDateString)(d.date) === "2026-05-01");
237
237
  expect(may1).toBeDefined();
238
238
  expect(may1 === null || may1 === void 0 ? void 0 : may1.currentMonth).toBe(false);
239
239
  });
240
240
  test("overflow days after April 2026 are May 1, 2, 3", () => {
241
- const days = (0, get_days_1.getDays)({ year: 2026, month: 3, firstDayOfWeek: 1 });
242
- const overflow = days.filter((d) => !d.currentMonth && (0, date_string_1.toDateString)(d.date) >= "2026-05-01");
243
- expect(overflow.map((d) => (0, date_string_1.toDateString)(d.date))).toEqual(["2026-05-01", "2026-05-02", "2026-05-03"]);
241
+ const days = (0, get_days_ts_1.getDays)({ year: 2026, month: 3, firstDayOfWeek: 1 });
242
+ const overflow = days.filter((d) => !d.currentMonth && (0, date_string_ts_1.toDateString)(d.date) >= "2026-05-01");
243
+ expect(overflow.map((d) => (0, date_string_ts_1.toDateString)(d.date))).toEqual(["2026-05-01", "2026-05-02", "2026-05-03"]);
244
244
  });
245
245
  });
246
246
  describe("getWeekdayLabels: exactly 7 labels in UTC+ timezone", () => {
@@ -248,13 +248,13 @@ describe("getWeekdayLabels: exactly 7 labels in UTC+ timezone", () => {
248
248
  // toDateString() falls back to local methods and shifts the date +1 day in UTC+
249
249
  // timezones, so getEach() returns 8 dates → 8 labels (last one is a duplicate Mon).
250
250
  test("returns exactly 7 labels with firstDayOfWeek=0", () => {
251
- expect((0, get_weekday_labels_1.getWeekdayLabels)({ firstDayOfWeek: 0 })).toHaveLength(7);
251
+ expect((0, get_weekday_labels_ts_1.getWeekdayLabels)({ firstDayOfWeek: 0 })).toHaveLength(7);
252
252
  });
253
253
  test("returns exactly 7 labels with firstDayOfWeek=1 (Monday-start)", () => {
254
- expect((0, get_weekday_labels_1.getWeekdayLabels)({ firstDayOfWeek: 1 })).toHaveLength(7);
254
+ expect((0, get_weekday_labels_ts_1.getWeekdayLabels)({ firstDayOfWeek: 1 })).toHaveLength(7);
255
255
  });
256
256
  test("Mo-start week is Mo…Su with no duplicates", () => {
257
- expect((0, get_weekday_labels_1.getWeekdayLabels)({ firstDayOfWeek: 1 })).toEqual(["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"]);
257
+ expect((0, get_weekday_labels_ts_1.getWeekdayLabels)({ firstDayOfWeek: 1 })).toEqual(["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"]);
258
258
  });
259
259
  });
260
260
  describe("getYears: exactly 9 years for ±4 decade view in UTC+ timezone", () => {
@@ -264,12 +264,12 @@ describe("getYears: exactly 9 years for ±4 decade view in UTC+ timezone", () =>
264
264
  test("year=2026: 9 years returned (2022–2030)", () => {
265
265
  const startYear = new Date("2022-01-01");
266
266
  const endYear = new Date("2030-01-01");
267
- expect((0, get_years_1.getYears)({ startYear, endYear })).toHaveLength(9);
267
+ expect((0, get_years_ts_1.getYears)({ startYear, endYear })).toHaveLength(9);
268
268
  });
269
269
  test("year=2026: first year is 2022, last is 2030", () => {
270
270
  const startYear = new Date("2022-01-01");
271
271
  const endYear = new Date("2030-01-01");
272
- const years = (0, get_years_1.getYears)({ startYear, endYear });
272
+ const years = (0, get_years_ts_1.getYears)({ startYear, endYear });
273
273
  expect(years[0].yearLabel).toBe("2022");
274
274
  expect(years[years.length - 1].yearLabel).toBe("2030");
275
275
  });
@@ -287,7 +287,7 @@ describe("getCurrentYearMonthAndDate: returns local calendar month in UTC+ timez
287
287
  // The function must always agree with the local calendar, whatever the offset.
288
288
  jest.setSystemTime(new Date("2021-08-31T22:30:00Z"));
289
289
  const expectedMonth = new Date("2021-08-31T22:30:00Z").getMonth(); // local month
290
- const result = (0, get_current_year_month_and_date_1.getCurrentYearMonthAndDate)();
290
+ const result = (0, get_current_year_month_and_date_ts_1.getCurrentYearMonthAndDate)();
291
291
  expect(result.month).toBe(expectedMonth);
292
292
  });
293
293
  });
@@ -297,13 +297,13 @@ describe("todayDateString: the device's calendar day, not the UTC one", () => {
297
297
  for (const iso of ["2026-11-20T22:30:00Z", "2026-11-21T03:30:00Z"]) {
298
298
  const now = new Date(iso);
299
299
  const local = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")}`;
300
- expect((0, date_string_1.todayDateString)(now.getTime())).toBe(local);
300
+ expect((0, date_string_ts_1.todayDateString)(now.getTime())).toBe(local);
301
301
  }
302
302
  });
303
303
  });
304
304
  describe("Range boundary checks", () => {
305
305
  test("canSelectRange: startDate on minBookingDate boundary is valid", () => {
306
- expect((0, can_select_range_1.canSelectRange)({
306
+ expect((0, can_select_range_ts_1.canSelectRange)({
307
307
  startDate: "2026-10-26",
308
308
  endDate: null,
309
309
  minBookingDays: 1,
@@ -314,7 +314,7 @@ describe("Range boundary checks", () => {
314
314
  })).toBe(true);
315
315
  });
316
316
  test("canSelectRange: endDate within maxBookingDate boundary is valid", () => {
317
- expect((0, can_select_range_1.canSelectRange)({
317
+ expect((0, can_select_range_ts_1.canSelectRange)({
318
318
  startDate: "2026-10-24",
319
319
  endDate: "2026-10-25",
320
320
  minBookingDays: 2,
@@ -325,7 +325,7 @@ describe("Range boundary checks", () => {
325
325
  })).toBe(true);
326
326
  });
327
327
  test("isDateHovered: date between startDate and hoveredDate is highlighted", () => {
328
- expect((0, is_date_hovered_1.isDateHovered)({
328
+ expect((0, is_date_hovered_ts_1.isDateHovered)({
329
329
  date: "2026-10-26",
330
330
  startDate: "2026-10-24",
331
331
  endDate: null,
@@ -1,2 +1,2 @@
1
- import { MonthType } from "./types";
1
+ import { MonthType } from "./types.ts";
2
2
  export declare function getCurrentYearMonthAndDate(): MonthType;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getCurrentYearMonthAndDate = getCurrentYearMonthAndDate;
4
- const get_date_month_and_year_1 = require("./get-date-month-and-year");
4
+ const get_date_month_and_year_ts_1 = require("./get-date-month-and-year.js");
5
5
  function getCurrentYearMonthAndDate() {
6
- return (0, get_date_month_and_year_1.getDateMonthAndYear)(new Date());
6
+ return (0, get_date_month_and_year_ts_1.getDateMonthAndYear)(new Date());
7
7
  }
@@ -1,18 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const get_current_year_month_and_date_1 = require("./get-current-year-month-and-date");
3
+ const get_current_year_month_and_date_ts_1 = require("./get-current-year-month-and-date.js");
4
4
  beforeAll(() => {
5
5
  jest.useFakeTimers();
6
6
  });
7
7
  test("getCurrentYearMonthAndDate", () => {
8
8
  jest.setSystemTime(new Date("2021-08-10"));
9
- expect((0, get_current_year_month_and_date_1.getCurrentYearMonthAndDate)()).toStrictEqual({
9
+ expect((0, get_current_year_month_and_date_ts_1.getCurrentYearMonthAndDate)()).toStrictEqual({
10
10
  year: 2021,
11
11
  month: 7,
12
12
  date: new Date("2021-08-01T00:00:00Z"),
13
13
  });
14
14
  jest.setSystemTime(new Date("2020-02-15"));
15
- expect((0, get_current_year_month_and_date_1.getCurrentYearMonthAndDate)()).toStrictEqual({
15
+ expect((0, get_current_year_month_and_date_ts_1.getCurrentYearMonthAndDate)()).toStrictEqual({
16
16
  year: 2020,
17
17
  month: 1,
18
18
  date: new Date("2020-02-01T00:00:00Z"),
@@ -1,40 +1,40 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const dayjs_utils_1 = require("./dayjs-utils");
4
- const get_date_invervals_1 = require("./get-date-invervals");
3
+ const dayjs_utils_ts_1 = require("./dayjs-utils.js");
4
+ const get_date_invervals_ts_1 = require("./get-date-invervals.js");
5
5
  describe("getDateIntervals", () => {
6
6
  it("should return empty array for empty input", () => {
7
- expect((0, get_date_invervals_1.getDateIntervals)([])).toStrictEqual([]);
7
+ expect((0, get_date_invervals_ts_1.getDateIntervals)([])).toStrictEqual([]);
8
8
  });
9
9
  it("should return single date as an interval", () => {
10
- const date = (0, dayjs_utils_1.dayjsEnWithTz)("2023-10-12").toDate();
11
- expect((0, get_date_invervals_1.getDateIntervals)([date])).toStrictEqual([{ start: date, end: date }]);
10
+ const date = (0, dayjs_utils_ts_1.dayjsEnWithTz)("2023-10-12").toDate();
11
+ expect((0, get_date_invervals_ts_1.getDateIntervals)([date])).toStrictEqual([{ start: date, end: date }]);
12
12
  });
13
13
  it("should group contiguous dates into intervals", () => {
14
14
  const dates = [
15
- (0, dayjs_utils_1.dayjsEnWithTz)("2023-10-12").toDate(),
16
- (0, dayjs_utils_1.dayjsEnWithTz)("2023-10-13").toDate(),
17
- (0, dayjs_utils_1.dayjsEnWithTz)("2023-10-14").toDate(),
18
- (0, dayjs_utils_1.dayjsEnWithTz)("2023-10-16").toDate(),
19
- (0, dayjs_utils_1.dayjsEnWithTz)("2023-10-17").toDate(),
15
+ (0, dayjs_utils_ts_1.dayjsEnWithTz)("2023-10-12").toDate(),
16
+ (0, dayjs_utils_ts_1.dayjsEnWithTz)("2023-10-13").toDate(),
17
+ (0, dayjs_utils_ts_1.dayjsEnWithTz)("2023-10-14").toDate(),
18
+ (0, dayjs_utils_ts_1.dayjsEnWithTz)("2023-10-16").toDate(),
19
+ (0, dayjs_utils_ts_1.dayjsEnWithTz)("2023-10-17").toDate(),
20
20
  ];
21
21
  const expected = [
22
22
  { start: dates.at(0), end: dates.at(2) },
23
23
  { start: dates.at(3), end: dates.at(4) },
24
24
  ];
25
- expect((0, get_date_invervals_1.getDateIntervals)(dates)).toStrictEqual(expected);
25
+ expect((0, get_date_invervals_ts_1.getDateIntervals)(dates)).toStrictEqual(expected);
26
26
  });
27
27
  it("should handle non-contiguous dates", () => {
28
28
  const dates = [
29
- (0, dayjs_utils_1.dayjsEnWithTz)("2023-10-12").toDate(),
30
- (0, dayjs_utils_1.dayjsEnWithTz)("2023-10-14").toDate(),
31
- (0, dayjs_utils_1.dayjsEnWithTz)("2023-10-16").toDate(),
29
+ (0, dayjs_utils_ts_1.dayjsEnWithTz)("2023-10-12").toDate(),
30
+ (0, dayjs_utils_ts_1.dayjsEnWithTz)("2023-10-14").toDate(),
31
+ (0, dayjs_utils_ts_1.dayjsEnWithTz)("2023-10-16").toDate(),
32
32
  ];
33
33
  const expected = [
34
34
  { start: dates.at(0), end: dates.at(0) },
35
35
  { start: dates.at(1), end: dates.at(1) },
36
36
  { start: dates.at(2), end: dates.at(2) },
37
37
  ];
38
- expect((0, get_date_invervals_1.getDateIntervals)(dates)).toStrictEqual(expected);
38
+ expect((0, get_date_invervals_ts_1.getDateIntervals)(dates)).toStrictEqual(expected);
39
39
  });
40
40
  });
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getDateIntervals = getDateIntervals;
4
- const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
5
- const date_string_1 = require("./date-string");
4
+ const is_not_nil_js_1 = require("@uxf/core/utils/is-not-nil.js");
5
+ const date_string_ts_1 = require("./date-string.js");
6
6
  function getDateIntervals(dates) {
7
7
  const sortedDates = dates.slice().sort((a, b) => a.getTime() - b.getTime());
8
8
  const intervals = [];
@@ -11,7 +11,7 @@ function getDateIntervals(dates) {
11
11
  let currentEnd = firstSortedDate !== null && firstSortedDate !== void 0 ? firstSortedDate : new Date();
12
12
  for (let i = 1; i < sortedDates.length; i++) {
13
13
  const currentDate = sortedDates[i];
14
- if ((0, date_string_1.toDateString)(currentDate) === (0, date_string_1.addDays)((0, date_string_1.toDateString)(currentEnd), 1)) {
14
+ if ((0, date_string_ts_1.toDateString)(currentDate) === (0, date_string_ts_1.addDays)((0, date_string_ts_1.toDateString)(currentEnd), 1)) {
15
15
  currentEnd = currentDate;
16
16
  }
17
17
  else {
@@ -20,7 +20,7 @@ function getDateIntervals(dates) {
20
20
  currentEnd = currentDate;
21
21
  }
22
22
  }
23
- if ((0, is_not_nil_1.isNotNil)(firstSortedDate)) {
23
+ if ((0, is_not_nil_js_1.isNotNil)(firstSortedDate)) {
24
24
  intervals.push({ start: currentStart, end: currentEnd });
25
25
  }
26
26
  return intervals;
@@ -1,2 +1,2 @@
1
- import { MonthType } from "./types";
1
+ import { MonthType } from "./types.ts";
2
2
  export declare function getDateMonthAndYear(date: Date): MonthType;
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getDateMonthAndYear = getDateMonthAndYear;
4
- const create_date_string_1 = require("./create-date-string");
5
- const date_string_1 = require("./date-string");
4
+ const create_date_string_ts_1 = require("./create-date-string.js");
5
+ const date_string_ts_1 = require("./date-string.js");
6
6
  function getDateMonthAndYear(date) {
7
- const ds = (0, date_string_1.toDateString)(date);
7
+ const ds = (0, date_string_ts_1.toDateString)(date);
8
8
  const year = parseInt(ds.slice(0, 4), 10);
9
9
  const month = parseInt(ds.slice(5, 7), 10) - 1; // 0-indexed, matching dayjs convention
10
10
  return {
11
11
  year,
12
12
  month,
13
- date: (0, date_string_1.fromDateString)((0, create_date_string_1.createDateString)(year, month)),
13
+ date: (0, date_string_ts_1.fromDateString)((0, create_date_string_ts_1.createDateString)(year, month)),
14
14
  };
15
15
  }
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const get_date_month_and_year_1 = require("./get-date-month-and-year");
3
+ const get_date_month_and_year_ts_1 = require("./get-date-month-and-year.js");
4
4
  test("getDateMonthAndYear", () => {
5
- expect((0, get_date_month_and_year_1.getDateMonthAndYear)(new Date("2021-08-10"))).toStrictEqual({
5
+ expect((0, get_date_month_and_year_ts_1.getDateMonthAndYear)(new Date("2021-08-10"))).toStrictEqual({
6
6
  year: 2021,
7
7
  month: 7,
8
8
  date: new Date("2021-08-01T00:00:00Z"),
9
9
  });
10
- expect((0, get_date_month_and_year_1.getDateMonthAndYear)(new Date("2020-02-15"))).toStrictEqual({
10
+ expect((0, get_date_month_and_year_ts_1.getDateMonthAndYear)(new Date("2020-02-15"))).toStrictEqual({
11
11
  year: 2020,
12
12
  month: 1,
13
13
  date: new Date("2020-02-01T00:00:00Z"),
@@ -1,9 +1,9 @@
1
- import { FirstDayOfWeek } from "./types";
1
+ import { FirstDayOfWeek } from "./types.ts";
2
2
  export interface GetDaysProps {
3
- year: number;
4
- month: number;
5
- firstDayOfWeek?: FirstDayOfWeek;
6
3
  dayLabelFormat?: (date: Date) => string;
4
+ firstDayOfWeek?: FirstDayOfWeek;
5
+ month: number;
6
+ year: number;
7
7
  }
8
8
  export type CalendarDay = {
9
9
  dayLabel: string;
package/utils/get-days.js CHANGED
@@ -1,39 +1,39 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getDays = getDays;
4
- const create_date_string_1 = require("./create-date-string");
5
- const date_string_1 = require("./date-string");
6
- const dayjs_utils_1 = require("./dayjs-utils");
7
- const get_each_1 = require("./get-each");
8
- function getDays({ year, month, firstDayOfWeek = 0, dayLabelFormat = (date) => (0, dayjs_utils_1.dayjsEnWithTz)(date).format("DD"), }) {
9
- const date = new Date((0, create_date_string_1.createDateString)(year, month));
4
+ const create_date_string_ts_1 = require("./create-date-string.js");
5
+ const date_string_ts_1 = require("./date-string.js");
6
+ const dayjs_utils_ts_1 = require("./dayjs-utils.js");
7
+ const get_each_ts_1 = require("./get-each.js");
8
+ function getDays({ year, month, firstDayOfWeek = 0, dayLabelFormat = (date) => (0, dayjs_utils_ts_1.dayjsEnWithTz)(date).format("DD"), }) {
9
+ const date = new Date((0, create_date_string_ts_1.createDateString)(year, month));
10
10
  const lastDayOfWeek = firstDayOfWeek + 7;
11
- const monthStart = (0, dayjs_utils_1.dayjsEnWithTz)(date).startOf("month");
11
+ const monthStart = (0, dayjs_utils_ts_1.dayjsEnWithTz)(date).startOf("month");
12
12
  const monthStartStr = monthStart.format("YYYY-MM-DD");
13
13
  const monthStartDay = monthStart.day();
14
- const monthEnd = (0, dayjs_utils_1.dayjsEnWithTz)(date).endOf("month");
14
+ const monthEnd = (0, dayjs_utils_ts_1.dayjsEnWithTz)(date).endOf("month");
15
15
  const monthEndStr = monthEnd.format("YYYY-MM-DD");
16
16
  const monthEndDay = monthEnd.day();
17
17
  const prevMonthDaysCount = monthStartDay >= firstDayOfWeek ? monthStartDay - firstDayOfWeek : 6 - firstDayOfWeek + monthStartDay + 1;
18
18
  const prevMonthDays = prevMonthDaysCount > 0
19
- ? (0, get_each_1.getEach)((0, date_string_1.addDays)(monthStartStr, -prevMonthDaysCount), (0, date_string_1.addDays)(monthStartStr, -1), "day").map((d) => ({
19
+ ? (0, get_each_ts_1.getEach)((0, date_string_ts_1.addDays)(monthStartStr, -prevMonthDaysCount), (0, date_string_ts_1.addDays)(monthStartStr, -1), "day").map((d) => ({
20
20
  currentMonth: false,
21
- date: (0, date_string_1.fromDateString)(d),
22
- dayLabel: dayLabelFormat((0, date_string_1.fromDateString)(d)),
21
+ date: (0, date_string_ts_1.fromDateString)(d),
22
+ dayLabel: dayLabelFormat((0, date_string_ts_1.fromDateString)(d)),
23
23
  }))
24
24
  : [];
25
25
  const nextMonthDaysCount = lastDayOfWeek - monthEndDay - 1;
26
26
  const nextMonthDays = nextMonthDaysCount > 0 && nextMonthDaysCount < 7
27
- ? (0, get_each_1.getEach)((0, date_string_1.addDays)(monthEndStr, 1), (0, date_string_1.addDays)(monthEndStr, nextMonthDaysCount), "day").map((d) => ({
27
+ ? (0, get_each_ts_1.getEach)((0, date_string_ts_1.addDays)(monthEndStr, 1), (0, date_string_ts_1.addDays)(monthEndStr, nextMonthDaysCount), "day").map((d) => ({
28
28
  currentMonth: false,
29
- date: (0, date_string_1.fromDateString)(d),
30
- dayLabel: dayLabelFormat((0, date_string_1.fromDateString)(d)),
29
+ date: (0, date_string_ts_1.fromDateString)(d),
30
+ dayLabel: dayLabelFormat((0, date_string_ts_1.fromDateString)(d)),
31
31
  }))
32
32
  : [];
33
- const days = (0, get_each_1.getEach)(monthStartStr, monthEndStr, "day").map((d) => ({
33
+ const days = (0, get_each_ts_1.getEach)(monthStartStr, monthEndStr, "day").map((d) => ({
34
34
  currentMonth: true,
35
- date: (0, date_string_1.fromDateString)(d),
36
- dayLabel: dayLabelFormat((0, date_string_1.fromDateString)(d)),
35
+ date: (0, date_string_ts_1.fromDateString)(d),
36
+ dayLabel: dayLabelFormat((0, date_string_ts_1.fromDateString)(d)),
37
37
  }));
38
38
  return [...prevMonthDays, ...days, ...nextMonthDays];
39
39
  }
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const dayjs_utils_1 = require("./dayjs-utils");
4
- const get_days_1 = require("./get-days");
3
+ const dayjs_utils_ts_1 = require("./dayjs-utils.js");
4
+ const get_days_ts_1 = require("./get-days.js");
5
5
  test("getDays", () => {
6
- expect((0, get_days_1.getDays)({ year: 2021, month: 0 })).toStrictEqual([
6
+ expect((0, get_days_ts_1.getDays)({ year: 2021, month: 0 })).toStrictEqual([
7
7
  { dayLabel: "27", date: new Date("2020-12-27T00:00:00Z"), currentMonth: false },
8
8
  { dayLabel: "28", date: new Date("2020-12-28T00:00:00Z"), currentMonth: false },
9
9
  { dayLabel: "29", date: new Date("2020-12-29T00:00:00Z"), currentMonth: false },
@@ -49,7 +49,7 @@ test("getDays", () => {
49
49
  ]);
50
50
  });
51
51
  test("getDays with custom format", () => {
52
- expect((0, get_days_1.getDays)({ year: 2021, month: 0, dayLabelFormat: (date) => (0, dayjs_utils_1.dayjsEnWithTz)(date).format("D") })).toStrictEqual([
52
+ expect((0, get_days_ts_1.getDays)({ year: 2021, month: 0, dayLabelFormat: (date) => (0, dayjs_utils_ts_1.dayjsEnWithTz)(date).format("D") })).toStrictEqual([
53
53
  { dayLabel: "27", date: new Date("2020-12-27T00:00:00Z"), currentMonth: false },
54
54
  { dayLabel: "28", date: new Date("2020-12-28T00:00:00Z"), currentMonth: false },
55
55
  { dayLabel: "29", date: new Date("2020-12-29T00:00:00Z"), currentMonth: false },
@@ -95,7 +95,7 @@ test("getDays with custom format", () => {
95
95
  ]);
96
96
  });
97
97
  test("getDays with custom firstDayOfWeek", () => {
98
- expect((0, get_days_1.getDays)({ year: 2021, month: 0, firstDayOfWeek: 1 })).toStrictEqual([
98
+ expect((0, get_days_ts_1.getDays)({ year: 2021, month: 0, firstDayOfWeek: 1 })).toStrictEqual([
99
99
  { dayLabel: "28", date: new Date("2020-12-28T00:00:00Z"), currentMonth: false },
100
100
  { dayLabel: "29", date: new Date("2020-12-29T00:00:00Z"), currentMonth: false },
101
101
  { dayLabel: "30", date: new Date("2020-12-30T00:00:00Z"), currentMonth: false },
@@ -1,2 +1,2 @@
1
- import { DateString } from "@uxf/core/date";
1
+ import { DateString } from "@uxf/core/date/index.js";
2
2
  export declare function getEach(start: DateString, end: DateString, type: "day" | "month" | "year"): DateString[];