@navikt/ds-react 7.13.0 → 7.14.0-alpha.1
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/cjs/date/Date.Dialog.d.ts +18 -0
- package/cjs/date/Date.Dialog.js +67 -0
- package/cjs/date/Date.Dialog.js.map +1 -0
- package/cjs/date/Date.Input.d.ts +50 -0
- package/cjs/date/Date.Input.js +96 -0
- package/cjs/date/Date.Input.js.map +1 -0
- package/cjs/date/Date.locale.d.ts +44 -0
- package/cjs/date/Date.locale.js +57 -0
- package/cjs/date/Date.locale.js.map +1 -0
- package/cjs/date/Date.typeutils.d.ts +14 -0
- package/cjs/date/Date.typeutils.js +15 -0
- package/cjs/date/Date.typeutils.js.map +1 -0
- package/cjs/date/date-utils/calendar-range.d.ts +11 -0
- package/cjs/date/date-utils/calendar-range.js +30 -0
- package/cjs/date/date-utils/calendar-range.js.map +1 -0
- package/cjs/date/date-utils/check-dates.d.ts +8 -0
- package/cjs/date/date-utils/check-dates.js +20 -0
- package/cjs/date/date-utils/check-dates.js.map +1 -0
- package/cjs/date/date-utils/clamp-dates.d.ts +19 -0
- package/cjs/date/date-utils/clamp-dates.js +41 -0
- package/cjs/date/date-utils/clamp-dates.js.map +1 -0
- package/cjs/date/date-utils/dates-disabled.d.ts +1 -0
- package/cjs/date/date-utils/dates-disabled.js +29 -0
- package/cjs/date/date-utils/dates-disabled.js.map +1 -0
- package/cjs/date/date-utils/dropdown-options.d.ts +13 -0
- package/cjs/date/date-utils/dropdown-options.js +45 -0
- package/cjs/date/date-utils/dropdown-options.js.map +1 -0
- package/cjs/date/date-utils/format-date.d.ts +2 -0
- package/cjs/date/date-utils/format-date.js +13 -0
- package/cjs/date/date-utils/format-date.js.map +1 -0
- package/cjs/date/date-utils/index.d.ts +8 -0
- package/cjs/date/date-utils/index.js +27 -0
- package/cjs/date/date-utils/index.js.map +1 -0
- package/cjs/date/date-utils/is-match.d.ts +3 -0
- package/cjs/date/date-utils/is-match.js +61 -0
- package/cjs/date/date-utils/is-match.js.map +1 -0
- package/cjs/date/date-utils/parse-date.d.ts +4 -0
- package/cjs/date/date-utils/parse-date.js +87 -0
- package/cjs/date/date-utils/parse-date.js.map +1 -0
- package/cjs/date/datepicker/DatePicker.d.ts +3 -3
- package/cjs/date/datepicker/DatePicker.js +47 -63
- package/cjs/date/datepicker/DatePicker.js.map +1 -1
- package/cjs/date/datepicker/DatePicker.types.d.ts +108 -0
- package/cjs/date/datepicker/DatePicker.types.js +3 -0
- package/cjs/date/datepicker/DatePicker.types.js.map +1 -0
- package/cjs/date/datepicker/hooks/useDatepicker.d.ts +90 -0
- package/cjs/date/datepicker/hooks/useDatepicker.js +164 -0
- package/cjs/date/datepicker/hooks/useDatepicker.js.map +1 -0
- package/cjs/date/datepicker/hooks/useRangeDatepicker.d.ts +76 -0
- package/cjs/date/datepicker/hooks/useRangeDatepicker.js +322 -0
- package/cjs/date/datepicker/hooks/useRangeDatepicker.js.map +1 -0
- package/cjs/date/datepicker/index.d.ts +4 -3
- package/cjs/date/datepicker/index.js +8 -7
- package/cjs/date/datepicker/index.js.map +1 -1
- package/cjs/date/datepicker/parts/DatePicker.DayButton.d.ts +9 -0
- package/cjs/date/datepicker/parts/DatePicker.DayButton.js +70 -0
- package/cjs/date/datepicker/parts/DatePicker.DayButton.js.map +1 -0
- package/cjs/date/datepicker/parts/DatePicker.Months.d.ts +11 -0
- package/cjs/date/datepicker/parts/DatePicker.Months.js +84 -0
- package/cjs/date/datepicker/parts/DatePicker.Months.js.map +1 -0
- package/cjs/date/datepicker/parts/DatePicker.RDP.d.ts +15 -0
- package/cjs/date/datepicker/parts/DatePicker.RDP.js +103 -0
- package/cjs/date/datepicker/parts/DatePicker.RDP.js.map +1 -0
- package/cjs/date/datepicker/parts/DatePicker.Standalone.d.ts +18 -0
- package/cjs/date/datepicker/parts/DatePicker.Standalone.js +60 -0
- package/cjs/date/datepicker/parts/DatePicker.Standalone.js.map +1 -0
- package/cjs/date/datepicker/parts/DatePicker.WeekNumber.d.ts +9 -0
- package/cjs/date/datepicker/parts/DatePicker.WeekNumber.js +64 -0
- package/cjs/date/datepicker/parts/DatePicker.WeekNumber.js.map +1 -0
- package/cjs/date/datepicker/parts/DatePicker.WeekRow.d.ts +8 -0
- package/cjs/date/datepicker/parts/DatePicker.WeekRow.js +28 -0
- package/cjs/date/datepicker/parts/DatePicker.WeekRow.js.map +1 -0
- package/cjs/date/monthpicker/MonthPicker.context.d.ts +21 -0
- package/cjs/date/monthpicker/MonthPicker.context.js +48 -0
- package/cjs/date/monthpicker/MonthPicker.context.js.map +1 -0
- package/cjs/date/monthpicker/MonthPicker.d.ts +3 -3
- package/cjs/date/monthpicker/MonthPicker.js +34 -43
- package/cjs/date/monthpicker/MonthPicker.js.map +1 -1
- package/cjs/date/monthpicker/MonthPicker.types.d.ts +86 -0
- package/cjs/date/monthpicker/MonthPicker.types.js +3 -0
- package/cjs/date/monthpicker/MonthPicker.types.js.map +1 -0
- package/cjs/date/monthpicker/MonthPicker.util.d.ts +2 -0
- package/cjs/date/monthpicker/MonthPicker.util.js +156 -0
- package/cjs/date/monthpicker/MonthPicker.util.js.map +1 -0
- package/cjs/date/monthpicker/hooks/useMonthPicker.d.ts +85 -0
- package/cjs/date/monthpicker/hooks/useMonthPicker.js +179 -0
- package/cjs/date/monthpicker/hooks/useMonthPicker.js.map +1 -0
- package/cjs/date/monthpicker/index.d.ts +4 -4
- package/cjs/date/monthpicker/index.js +6 -6
- package/cjs/date/monthpicker/index.js.map +1 -1
- package/cjs/date/monthpicker/parts/MonthPicker.Button.d.ts +11 -0
- package/cjs/date/monthpicker/parts/MonthPicker.Button.js +82 -0
- package/cjs/date/monthpicker/parts/MonthPicker.Button.js.map +1 -0
- package/cjs/date/monthpicker/parts/MonthPicker.Caption.d.ts +3 -0
- package/cjs/date/monthpicker/parts/MonthPicker.Caption.js +52 -0
- package/cjs/date/monthpicker/parts/MonthPicker.Caption.js.map +1 -0
- package/cjs/date/monthpicker/parts/MonthPicker.Standalone.d.ts +10 -0
- package/cjs/date/monthpicker/parts/MonthPicker.Standalone.js +51 -0
- package/cjs/date/monthpicker/parts/MonthPicker.Standalone.js.map +1 -0
- package/cjs/date/monthpicker/parts/MonthPicker.Table.d.ts +3 -0
- package/cjs/date/monthpicker/parts/MonthPicker.Table.js +79 -0
- package/cjs/date/monthpicker/parts/MonthPicker.Table.js.map +1 -0
- package/cjs/form/combobox/Combobox.d.ts +1 -1
- package/cjs/form/combobox/Input/InputController.d.ts +1 -1
- package/cjs/modal/Modal.js +2 -2
- package/cjs/modal/Modal.js.map +1 -1
- package/cjs/popover/Popover.js +3 -3
- package/cjs/popover/Popover.js.map +1 -1
- package/cjs/tooltip/Tooltip.js +2 -5
- package/cjs/tooltip/Tooltip.js.map +1 -1
- package/esm/date/Date.Dialog.d.ts +18 -0
- package/esm/date/Date.Dialog.js +38 -0
- package/esm/date/Date.Dialog.js.map +1 -0
- package/esm/date/Date.Input.d.ts +50 -0
- package/esm/date/Date.Input.js +66 -0
- package/esm/date/Date.Input.js.map +1 -0
- package/esm/date/Date.locale.d.ts +44 -0
- package/esm/date/Date.locale.js +47 -0
- package/esm/date/Date.locale.js.map +1 -0
- package/esm/date/Date.typeutils.d.ts +14 -0
- package/esm/date/Date.typeutils.js +10 -0
- package/esm/date/Date.typeutils.js.map +1 -0
- package/esm/date/date-utils/calendar-range.d.ts +11 -0
- package/esm/date/date-utils/calendar-range.js +27 -0
- package/esm/date/date-utils/calendar-range.js.map +1 -0
- package/esm/date/date-utils/check-dates.d.ts +8 -0
- package/esm/date/date-utils/check-dates.js +14 -0
- package/esm/date/date-utils/check-dates.js.map +1 -0
- package/esm/date/date-utils/clamp-dates.d.ts +19 -0
- package/esm/date/date-utils/clamp-dates.js +37 -0
- package/esm/date/date-utils/clamp-dates.js.map +1 -0
- package/esm/date/date-utils/dates-disabled.d.ts +1 -0
- package/esm/date/date-utils/dates-disabled.js +25 -0
- package/esm/date/date-utils/dates-disabled.js.map +1 -0
- package/esm/date/date-utils/dropdown-options.d.ts +13 -0
- package/esm/date/date-utils/dropdown-options.js +41 -0
- package/esm/date/date-utils/dropdown-options.js.map +1 -0
- package/esm/date/date-utils/format-date.d.ts +2 -0
- package/esm/date/date-utils/format-date.js +9 -0
- package/esm/date/date-utils/format-date.js.map +1 -0
- package/esm/date/date-utils/index.d.ts +8 -0
- package/esm/date/date-utils/index.js +9 -0
- package/esm/date/date-utils/index.js.map +1 -0
- package/esm/date/date-utils/is-match.d.ts +3 -0
- package/esm/date/date-utils/is-match.js +57 -0
- package/esm/date/date-utils/is-match.js.map +1 -0
- package/esm/date/date-utils/parse-date.d.ts +4 -0
- package/esm/date/date-utils/parse-date.js +83 -0
- package/esm/date/date-utils/parse-date.js.map +1 -0
- package/esm/date/datepicker/DatePicker.d.ts +3 -3
- package/esm/date/datepicker/DatePicker.js +46 -62
- package/esm/date/datepicker/DatePicker.js.map +1 -1
- package/esm/date/datepicker/DatePicker.types.d.ts +108 -0
- package/esm/date/datepicker/DatePicker.types.js +2 -0
- package/esm/date/datepicker/DatePicker.types.js.map +1 -0
- package/esm/date/datepicker/hooks/useDatepicker.d.ts +90 -0
- package/esm/date/datepicker/hooks/useDatepicker.js +160 -0
- package/esm/date/datepicker/hooks/useDatepicker.js.map +1 -0
- package/esm/date/datepicker/hooks/useRangeDatepicker.d.ts +76 -0
- package/esm/date/datepicker/hooks/useRangeDatepicker.js +318 -0
- package/esm/date/datepicker/hooks/useRangeDatepicker.js.map +1 -0
- package/esm/date/datepicker/index.d.ts +4 -3
- package/esm/date/datepicker/index.js +4 -3
- package/esm/date/datepicker/index.js.map +1 -1
- package/esm/date/datepicker/parts/DatePicker.DayButton.d.ts +9 -0
- package/esm/date/datepicker/parts/DatePicker.DayButton.js +41 -0
- package/esm/date/datepicker/parts/DatePicker.DayButton.js.map +1 -0
- package/esm/date/datepicker/parts/DatePicker.Months.d.ts +11 -0
- package/esm/date/datepicker/parts/DatePicker.Months.js +58 -0
- package/esm/date/datepicker/parts/DatePicker.Months.js.map +1 -0
- package/esm/date/datepicker/parts/DatePicker.RDP.d.ts +15 -0
- package/esm/date/datepicker/parts/DatePicker.RDP.js +74 -0
- package/esm/date/datepicker/parts/DatePicker.RDP.js.map +1 -0
- package/esm/date/datepicker/parts/DatePicker.Standalone.d.ts +18 -0
- package/esm/date/datepicker/parts/DatePicker.Standalone.js +31 -0
- package/esm/date/datepicker/parts/DatePicker.Standalone.js.map +1 -0
- package/esm/date/datepicker/parts/DatePicker.WeekNumber.d.ts +9 -0
- package/esm/date/datepicker/parts/DatePicker.WeekNumber.js +35 -0
- package/esm/date/datepicker/parts/DatePicker.WeekNumber.js.map +1 -0
- package/esm/date/datepicker/parts/DatePicker.WeekRow.d.ts +8 -0
- package/esm/date/datepicker/parts/DatePicker.WeekRow.js +22 -0
- package/esm/date/datepicker/parts/DatePicker.WeekRow.js.map +1 -0
- package/esm/date/monthpicker/MonthPicker.context.d.ts +21 -0
- package/esm/date/monthpicker/MonthPicker.context.js +41 -0
- package/esm/date/monthpicker/MonthPicker.context.js.map +1 -0
- package/esm/date/monthpicker/MonthPicker.d.ts +3 -3
- package/esm/date/monthpicker/MonthPicker.js +31 -40
- package/esm/date/monthpicker/MonthPicker.js.map +1 -1
- package/esm/date/monthpicker/MonthPicker.types.d.ts +86 -0
- package/esm/date/monthpicker/MonthPicker.types.js +2 -0
- package/esm/date/monthpicker/MonthPicker.types.js.map +1 -0
- package/esm/date/monthpicker/MonthPicker.util.d.ts +2 -0
- package/esm/date/monthpicker/MonthPicker.util.js +152 -0
- package/esm/date/monthpicker/MonthPicker.util.js.map +1 -0
- package/esm/date/monthpicker/hooks/useMonthPicker.d.ts +85 -0
- package/esm/date/monthpicker/hooks/useMonthPicker.js +175 -0
- package/esm/date/monthpicker/hooks/useMonthPicker.js.map +1 -0
- package/esm/date/monthpicker/index.d.ts +4 -4
- package/esm/date/monthpicker/index.js +3 -3
- package/esm/date/monthpicker/index.js.map +1 -1
- package/esm/date/monthpicker/parts/MonthPicker.Button.d.ts +11 -0
- package/esm/date/monthpicker/parts/MonthPicker.Button.js +52 -0
- package/esm/date/monthpicker/parts/MonthPicker.Button.js.map +1 -0
- package/esm/date/monthpicker/parts/MonthPicker.Caption.d.ts +3 -0
- package/esm/date/monthpicker/parts/MonthPicker.Caption.js +46 -0
- package/esm/date/monthpicker/parts/MonthPicker.Caption.js.map +1 -0
- package/esm/date/monthpicker/parts/MonthPicker.Standalone.d.ts +10 -0
- package/esm/date/monthpicker/parts/MonthPicker.Standalone.js +22 -0
- package/esm/date/monthpicker/parts/MonthPicker.Standalone.js.map +1 -0
- package/esm/date/monthpicker/parts/MonthPicker.Table.d.ts +3 -0
- package/esm/date/monthpicker/parts/MonthPicker.Table.js +50 -0
- package/esm/date/monthpicker/parts/MonthPicker.Table.js.map +1 -0
- package/esm/form/combobox/Combobox.d.ts +1 -1
- package/esm/form/combobox/Input/InputController.d.ts +1 -1
- package/esm/modal/Modal.js +3 -3
- package/esm/modal/Modal.js.map +1 -1
- package/esm/popover/Popover.js +4 -4
- package/esm/popover/Popover.js.map +1 -1
- package/esm/tooltip/Tooltip.js +2 -5
- package/esm/tooltip/Tooltip.js.map +1 -1
- package/package.json +6 -7
- package/src/date/{parts/DateWrapper.tsx → Date.Dialog.tsx} +12 -9
- package/src/date/{parts/DateInput.tsx → Date.Input.tsx} +30 -5
- package/src/date/{utils/locale.ts → Date.locale.ts} +11 -2
- package/src/date/Date.typeutils.ts +32 -0
- package/src/date/date-utils/calendar-range.test.ts +54 -0
- package/src/date/date-utils/calendar-range.ts +46 -0
- package/src/date/date-utils/check-dates.test.ts +49 -0
- package/src/date/date-utils/check-dates.ts +28 -0
- package/src/date/date-utils/clamp-dates.test.ts +156 -0
- package/src/date/date-utils/clamp-dates.ts +63 -0
- package/src/date/{utils/__tests__ → date-utils}/dates-disabled.test.ts +1 -1
- package/src/date/{utils → date-utils}/dates-disabled.ts +1 -2
- package/src/date/date-utils/dropdown-options.test.ts +143 -0
- package/src/date/date-utils/dropdown-options.ts +79 -0
- package/src/date/{utils/__tests__ → date-utils}/format-dates.test.ts +2 -2
- package/src/date/date-utils/index.ts +16 -0
- package/src/date/{utils/__tests__ → date-utils}/is-match.test.ts +1 -1
- package/src/date/{utils → date-utils}/is-match.ts +2 -11
- package/src/date/{utils/__tests__ → date-utils}/parse-dates.test.ts +2 -1
- package/src/date/datepicker/DatePicker.tsx +67 -92
- package/src/date/datepicker/{types.ts → DatePicker.types.ts} +10 -4
- package/src/date/{hooks → datepicker/hooks}/useDatepicker.tsx +12 -13
- package/src/date/{hooks → datepicker/hooks}/useRangeDatepicker.test.tsx +1 -1
- package/src/date/{hooks → datepicker/hooks}/useRangeDatepicker.tsx +19 -19
- package/src/date/datepicker/index.ts +4 -5
- package/src/date/datepicker/parts/DatePicker.DayButton.tsx +56 -0
- package/src/date/datepicker/parts/DatePicker.Months.tsx +149 -0
- package/src/date/datepicker/parts/DatePicker.RDP.tsx +170 -0
- package/src/date/datepicker/parts/DatePicker.Standalone.tsx +93 -0
- package/src/date/datepicker/parts/DatePicker.WeekNumber.tsx +86 -0
- package/src/date/datepicker/parts/{WeekRow.tsx → DatePicker.WeekRow.tsx} +20 -21
- package/src/date/monthpicker/MonthPicker.context.tsx +103 -0
- package/src/date/monthpicker/MonthPicker.tsx +63 -68
- package/src/date/monthpicker/{types.ts → MonthPicker.types.ts} +1 -1
- package/src/date/{utils/navigation.ts → monthpicker/MonthPicker.util.ts} +2 -1
- package/src/date/{hooks → monthpicker/hooks}/useMonthPicker.tsx +14 -13
- package/src/date/monthpicker/index.ts +4 -4
- package/src/date/monthpicker/{MonthButton.tsx → parts/MonthPicker.Button.tsx} +21 -10
- package/src/date/monthpicker/{MonthCaption.tsx → parts/MonthPicker.Caption.tsx} +20 -21
- package/src/date/monthpicker/parts/MonthPicker.Standalone.tsx +86 -0
- package/src/date/monthpicker/{MonthSelector.tsx → parts/MonthPicker.Table.tsx} +7 -7
- package/src/modal/Modal.tsx +3 -3
- package/src/popover/Popover.tsx +4 -4
- package/src/tooltip/Tooltip.tsx +2 -6
- package/src/date/context/index.ts +0 -9
- package/src/date/context/useDateInputContext.tsx +0 -34
- package/src/date/context/useDateTranslationContext.ts +0 -9
- package/src/date/context/useSharedMonthContext.tsx +0 -68
- package/src/date/datepicker/DatePickerStandalone.tsx +0 -136
- package/src/date/datepicker/datepicker.test.tsx +0 -28
- package/src/date/datepicker/parts/Caption.tsx +0 -54
- package/src/date/datepicker/parts/DayButton.tsx +0 -32
- package/src/date/datepicker/parts/DropdownCaption.tsx +0 -110
- package/src/date/datepicker/parts/HeadRow.tsx +0 -56
- package/src/date/datepicker/parts/Row.tsx +0 -48
- package/src/date/datepicker/parts/TableHead.tsx +0 -17
- package/src/date/datepicker/parts/WeekNumber.tsx +0 -75
- package/src/date/hooks/index.ts +0 -6
- package/src/date/monthpicker/MonthPickerStandalone.tsx +0 -102
- package/src/date/utils/__tests__/check-dates.test.ts +0 -22
- package/src/date/utils/__tests__/get-dates.test.ts +0 -121
- package/src/date/utils/__tests__/get-initial-year.test.ts +0 -83
- package/src/date/utils/__tests__/get-month-weeks.test.ts +0 -116
- package/src/date/utils/check-dates.ts +0 -13
- package/src/date/utils/get-dates.ts +0 -60
- package/src/date/utils/get-initial-year.ts +0 -25
- package/src/date/utils/get-month-weeks.ts +0 -93
- package/src/date/utils/index.ts +0 -18
- /package/src/date/{utils → date-utils}/format-date.ts +0 -0
- /package/src/date/{utils → date-utils}/parse-date.ts +0 -0
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "vitest";
|
|
2
|
-
import { getMonths, getYears } from "..";
|
|
3
|
-
|
|
4
|
-
describe("Extracts correct months", () => {
|
|
5
|
-
test("March - October (8)", () => {
|
|
6
|
-
const t = {
|
|
7
|
-
start: new Date(2019, 2, 22),
|
|
8
|
-
end: new Date(2019, 9, 22),
|
|
9
|
-
current: new Date(2019, 6, 22),
|
|
10
|
-
res: 8,
|
|
11
|
-
};
|
|
12
|
-
expect(getMonths(t.start, t.end, t.current).length).toEqual(t.res);
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
test("Only first 7 months", () => {
|
|
16
|
-
const t = {
|
|
17
|
-
start: new Date(2019, 0, 22),
|
|
18
|
-
end: new Date(2022, 7, 22),
|
|
19
|
-
current: new Date(2022, 6, 22),
|
|
20
|
-
res: 8,
|
|
21
|
-
};
|
|
22
|
-
expect(getMonths(t.start, t.end, t.current).length).toEqual(t.res);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
test("All of 2019 when only 2019 avaliable (12)", () => {
|
|
26
|
-
const t = {
|
|
27
|
-
start: new Date(2019, 0, 22),
|
|
28
|
-
end: new Date(2019, 11, 22),
|
|
29
|
-
current: new Date(2019, 6, 22),
|
|
30
|
-
res: 12,
|
|
31
|
-
};
|
|
32
|
-
expect(getMonths(t.start, t.end, t.current).length).toEqual(t.res);
|
|
33
|
-
});
|
|
34
|
-
test("All of 2019 when start + current is 2019 and end is later(12)", () => {
|
|
35
|
-
const t = {
|
|
36
|
-
start: new Date(2019, 0, 22),
|
|
37
|
-
end: new Date(2022, 7, 22),
|
|
38
|
-
current: new Date(2019, 6, 22),
|
|
39
|
-
res: 12,
|
|
40
|
-
};
|
|
41
|
-
expect(getMonths(t.start, t.end, t.current).length).toEqual(t.res);
|
|
42
|
-
});
|
|
43
|
-
test("All of 2020 when between 2019 and 2022 (12)", () => {
|
|
44
|
-
const t = {
|
|
45
|
-
start: new Date(2019, 0, 22),
|
|
46
|
-
end: new Date(2022, 7, 22),
|
|
47
|
-
current: new Date(2020, 6, 22),
|
|
48
|
-
res: 12,
|
|
49
|
-
};
|
|
50
|
-
expect(getMonths(t.start, t.end, t.current).length).toEqual(t.res);
|
|
51
|
-
});
|
|
52
|
-
test("Tail part of 2019, including starting month (12)", () => {
|
|
53
|
-
const t = {
|
|
54
|
-
start: new Date(2019, 5, 22),
|
|
55
|
-
end: new Date(2022, 7, 22),
|
|
56
|
-
current: new Date(2019, 6, 22),
|
|
57
|
-
res: 7,
|
|
58
|
-
};
|
|
59
|
-
expect(getMonths(t.start, t.end, t.current).length).toEqual(t.res);
|
|
60
|
-
});
|
|
61
|
-
test("End part of 2022, including starting month (12)", () => {
|
|
62
|
-
const t = {
|
|
63
|
-
start: new Date(2019, 5, 22),
|
|
64
|
-
end: new Date(2022, 7, 22),
|
|
65
|
-
current: new Date(2022, 7, 22),
|
|
66
|
-
res: 8,
|
|
67
|
-
};
|
|
68
|
-
expect(getMonths(t.start, t.end, t.current).length).toEqual(t.res);
|
|
69
|
-
});
|
|
70
|
-
test("Adds out of range month to list (13)", () => {
|
|
71
|
-
const t = {
|
|
72
|
-
start: new Date(2019, 5, 22),
|
|
73
|
-
end: new Date(2022, 7, 22),
|
|
74
|
-
current: new Date(2022, 9, 22),
|
|
75
|
-
res: 9,
|
|
76
|
-
};
|
|
77
|
-
expect(getMonths(t.start, t.end, t.current).length).toEqual(t.res);
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
describe("Extracts correct years", () => {
|
|
82
|
-
test("Same year (1)", () => {
|
|
83
|
-
const t = {
|
|
84
|
-
start: new Date(2019, 2, 22),
|
|
85
|
-
end: new Date(2019, 9, 22),
|
|
86
|
-
current: 2019,
|
|
87
|
-
res: 1,
|
|
88
|
-
};
|
|
89
|
-
expect(getYears(t.start, t.end, t.current).length).toEqual(t.res);
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
test("Multiple years (11)", () => {
|
|
93
|
-
const t = {
|
|
94
|
-
start: new Date(2019, 2, 22),
|
|
95
|
-
end: new Date(2029, 9, 22),
|
|
96
|
-
current: 2022,
|
|
97
|
-
res: 11,
|
|
98
|
-
};
|
|
99
|
-
expect(getYears(t.start, t.end, t.current).length).toEqual(t.res);
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
test("Displaymonth outside range: after (11)", () => {
|
|
103
|
-
const t = {
|
|
104
|
-
start: new Date(2019, 2, 22),
|
|
105
|
-
end: new Date(2029, 9, 22),
|
|
106
|
-
current: 2040,
|
|
107
|
-
res: 12,
|
|
108
|
-
};
|
|
109
|
-
expect(getYears(t.start, t.end, t.current).length).toEqual(t.res);
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
test("Displaymonth outside range: before (11)", () => {
|
|
113
|
-
const t = {
|
|
114
|
-
start: new Date(2019, 2, 22),
|
|
115
|
-
end: new Date(2029, 9, 22),
|
|
116
|
-
current: 2001,
|
|
117
|
-
res: 12,
|
|
118
|
-
};
|
|
119
|
-
expect(getYears(t.start, t.end, t.current).length).toEqual(t.res);
|
|
120
|
-
});
|
|
121
|
-
});
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { isSameYear } from "date-fns";
|
|
2
|
-
import { describe, expect, test } from "vitest";
|
|
3
|
-
import { getInitialYear } from "..";
|
|
4
|
-
|
|
5
|
-
describe("Returns initial year for monthpicker", () => {
|
|
6
|
-
test("Default selected should be valid (true)", () => {
|
|
7
|
-
expect(
|
|
8
|
-
isSameYear(
|
|
9
|
-
new Date("Oct 4 2021"),
|
|
10
|
-
getInitialYear({
|
|
11
|
-
defaultMonth: new Date("Aug 4 2021"),
|
|
12
|
-
}),
|
|
13
|
-
),
|
|
14
|
-
).toBeTruthy();
|
|
15
|
-
});
|
|
16
|
-
test("Default selected should not be valid (false)", () => {
|
|
17
|
-
expect(
|
|
18
|
-
isSameYear(
|
|
19
|
-
new Date("Oct 4 2021"),
|
|
20
|
-
getInitialYear({
|
|
21
|
-
defaultMonth: new Date("Aug 4 2020"),
|
|
22
|
-
}),
|
|
23
|
-
),
|
|
24
|
-
).toBeFalsy();
|
|
25
|
-
});
|
|
26
|
-
test("Default selected should be valid with fromDate", () => {
|
|
27
|
-
expect(
|
|
28
|
-
isSameYear(
|
|
29
|
-
new Date("Oct 4 2021"),
|
|
30
|
-
getInitialYear({
|
|
31
|
-
defaultMonth: new Date("Aug 4 2021"),
|
|
32
|
-
/* toDate: new Date("Oct 4 2021"), */
|
|
33
|
-
fromDate: new Date("Oct 4 2021"),
|
|
34
|
-
}),
|
|
35
|
-
),
|
|
36
|
-
).toBeTruthy();
|
|
37
|
-
});
|
|
38
|
-
test("Default selected should be valid with toDate", () => {
|
|
39
|
-
expect(
|
|
40
|
-
isSameYear(
|
|
41
|
-
new Date("Oct 4 2021"),
|
|
42
|
-
getInitialYear({
|
|
43
|
-
defaultMonth: new Date("Aug 4 2021"),
|
|
44
|
-
toDate: new Date("Jun 4 2021"),
|
|
45
|
-
}),
|
|
46
|
-
),
|
|
47
|
-
).toBeTruthy();
|
|
48
|
-
});
|
|
49
|
-
test("Default selected should be moved to toDate", () => {
|
|
50
|
-
expect(
|
|
51
|
-
isSameYear(
|
|
52
|
-
new Date("Oct 4 2020"),
|
|
53
|
-
getInitialYear({
|
|
54
|
-
defaultMonth: new Date("Aug 4 2021"),
|
|
55
|
-
toDate: new Date("Jun 4 2020"),
|
|
56
|
-
}),
|
|
57
|
-
),
|
|
58
|
-
).toBeTruthy();
|
|
59
|
-
});
|
|
60
|
-
test("Default selected should be moved to fromDate", () => {
|
|
61
|
-
expect(
|
|
62
|
-
isSameYear(
|
|
63
|
-
new Date("Oct 4 2022"),
|
|
64
|
-
getInitialYear({
|
|
65
|
-
defaultMonth: new Date("Aug 4 2021"),
|
|
66
|
-
fromDate: new Date("Jun 4 2022"),
|
|
67
|
-
}),
|
|
68
|
-
),
|
|
69
|
-
).toBeTruthy();
|
|
70
|
-
});
|
|
71
|
-
test("Default selected should be moved to fromDate, not toDate", () => {
|
|
72
|
-
expect(
|
|
73
|
-
isSameYear(
|
|
74
|
-
new Date("Oct 4 2022"),
|
|
75
|
-
getInitialYear({
|
|
76
|
-
defaultMonth: new Date("Aug 4 2021"),
|
|
77
|
-
toDate: new Date("Oct 4 2023"),
|
|
78
|
-
fromDate: new Date("Jun 4 2022"),
|
|
79
|
-
}),
|
|
80
|
-
),
|
|
81
|
-
).toBeTruthy();
|
|
82
|
-
});
|
|
83
|
-
});
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
/* https://github.com/gpbl/react-day-picker/blob/main/src/components/Table/utils/getMonthWeeks.test.ts */
|
|
2
|
-
import { enGB, nb } from "date-fns/locale";
|
|
3
|
-
import { describe, expect, test } from "vitest";
|
|
4
|
-
import { getMonthWeeks } from "../get-month-weeks";
|
|
5
|
-
|
|
6
|
-
describe('when using the "nB" locale', () => {
|
|
7
|
-
const locale = nb;
|
|
8
|
-
describe("when getting the weeks for January 2022", () => {
|
|
9
|
-
const weeks = getMonthWeeks(new Date(2022, 0), { locale });
|
|
10
|
-
test("the first week should be the last of the previous year", () => {
|
|
11
|
-
const weekNumbers = weeks.map((week) => week.weekNumber);
|
|
12
|
-
expect(weekNumbers[0]).toEqual(52);
|
|
13
|
-
});
|
|
14
|
-
test("the first week should contain days from previous year", () => {
|
|
15
|
-
expect(weeks[0].dates.map((date) => date.getDate())).toEqual([
|
|
16
|
-
27, 28, 29, 30, 31, 1, 2,
|
|
17
|
-
]);
|
|
18
|
-
});
|
|
19
|
-
test("the last week should be the last of January", () => {
|
|
20
|
-
const weekNumbers = weeks.map((week) => week.weekNumber);
|
|
21
|
-
expect(weekNumbers[weekNumbers.length - 1]).toEqual(5);
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
describe('when using the "enGB" locale', () => {
|
|
27
|
-
const locale = enGB;
|
|
28
|
-
describe("when using fixed weeks", () => {
|
|
29
|
-
const useFixedWeeks = true;
|
|
30
|
-
describe("when getting the weeks for December 2022", () => {
|
|
31
|
-
const weeks = getMonthWeeks(new Date(2022, 11), {
|
|
32
|
-
useFixedWeeks,
|
|
33
|
-
locale,
|
|
34
|
-
});
|
|
35
|
-
test("should return 48 - 1 week numbers", () => {
|
|
36
|
-
const weekNumbers = weeks.map((week) => week.weekNumber);
|
|
37
|
-
const expectedResult = [48, 49, 50, 51, 52, 1];
|
|
38
|
-
expect(weekNumbers).toEqual(expectedResult);
|
|
39
|
-
});
|
|
40
|
-
test("the last week should be the one in the next year", () => {
|
|
41
|
-
const lastWeek = weeks[weeks.length - 1];
|
|
42
|
-
const lastWeekDates = lastWeek.dates.map((date) => date.getDate());
|
|
43
|
-
const expectedResult = [2, 3, 4, 5, 6, 7, 8];
|
|
44
|
-
expect(lastWeekDates).toEqual(expectedResult);
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
describe("when getting the weeks for December 2021", () => {
|
|
48
|
-
const weeks = getMonthWeeks(new Date(2021, 11), {
|
|
49
|
-
useFixedWeeks,
|
|
50
|
-
locale,
|
|
51
|
-
});
|
|
52
|
-
test("should return 48 - 1 week numbers", () => {
|
|
53
|
-
const weekNumbers = weeks.map((week) => week.weekNumber);
|
|
54
|
-
const expectedResult = [48, 49, 50, 51, 52, 1];
|
|
55
|
-
expect(weekNumbers).toEqual(expectedResult);
|
|
56
|
-
});
|
|
57
|
-
test("week 1 contains the first day of the new year", () => {
|
|
58
|
-
expect(weeks[4].dates.map((date) => date.getDate())).toEqual([
|
|
59
|
-
27, 28, 29, 30, 31, 1, 2,
|
|
60
|
-
]);
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
describe('when using the "nb" locale', () => {
|
|
67
|
-
const locale = nb;
|
|
68
|
-
describe("when using fixed weeks", () => {
|
|
69
|
-
const useFixedWeeks = true;
|
|
70
|
-
describe("when getting the weeks for December 2022", () => {
|
|
71
|
-
const weeks = getMonthWeeks(new Date(2022, 11), {
|
|
72
|
-
useFixedWeeks,
|
|
73
|
-
locale,
|
|
74
|
-
});
|
|
75
|
-
test("should return 48 - 1 week numbers", () => {
|
|
76
|
-
const weekNumbers = weeks.map((week) => week.weekNumber);
|
|
77
|
-
const expectedResult = [48, 49, 50, 51, 52, 1];
|
|
78
|
-
expect(weekNumbers).toEqual(expectedResult);
|
|
79
|
-
});
|
|
80
|
-
test("the last week should be the one in the next year", () => {
|
|
81
|
-
const lastWeek = weeks[weeks.length - 1];
|
|
82
|
-
const lastWeekDates = lastWeek.dates.map((date) => date.getDate());
|
|
83
|
-
const expectedResult = [2, 3, 4, 5, 6, 7, 8];
|
|
84
|
-
expect(lastWeekDates).toEqual(expectedResult);
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
describe("when getting the weeks for December 2021", () => {
|
|
88
|
-
const weeks = getMonthWeeks(new Date(2021, 11), {
|
|
89
|
-
useFixedWeeks,
|
|
90
|
-
locale,
|
|
91
|
-
});
|
|
92
|
-
test("should return 48 - 1 week numbers", () => {
|
|
93
|
-
const weekNumbers = weeks.map((week) => week.weekNumber);
|
|
94
|
-
const expectedResult = [48, 49, 50, 51, 52, 1];
|
|
95
|
-
expect(weekNumbers).toEqual(expectedResult);
|
|
96
|
-
});
|
|
97
|
-
test("week 1 contains the first day of the new year", () => {
|
|
98
|
-
expect(weeks[4].dates.map((date) => date.getDate())).toEqual([
|
|
99
|
-
27, 28, 29, 30, 31, 1, 2,
|
|
100
|
-
]);
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
describe("getMonthWeeks should calculate week-number corectly", () => {
|
|
107
|
-
const locale = nb;
|
|
108
|
-
describe("when getting the weeks for September 2022", () => {
|
|
109
|
-
const date = new Date(2022, 8);
|
|
110
|
-
const weeks = getMonthWeeks(date, { locale });
|
|
111
|
-
test("the last week should have number 39", () => {
|
|
112
|
-
const weekNumbers = weeks.map((week) => week.weekNumber);
|
|
113
|
-
expect(weekNumbers[weekNumbers.length - 1]).toEqual(39);
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { isThisMonth, setYear } from "date-fns";
|
|
2
|
-
|
|
3
|
-
export const dateIsInCurrentMonth = (
|
|
4
|
-
date: Date,
|
|
5
|
-
dateToCompare: Date,
|
|
6
|
-
): boolean => {
|
|
7
|
-
return isThisMonth(setYear(date, Number(dateToCompare.getFullYear())));
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
/** @private */
|
|
11
|
-
export function isValidDate(day?: Date): boolean {
|
|
12
|
-
return !!(day && !Number.isNaN(day.getTime()) && day.getFullYear() > 999);
|
|
13
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isSameYear,
|
|
3
|
-
setMonth,
|
|
4
|
-
setYear,
|
|
5
|
-
startOfMonth,
|
|
6
|
-
startOfYear,
|
|
7
|
-
} from "date-fns";
|
|
8
|
-
|
|
9
|
-
export const getMonths = (start: Date, end: Date, current: Date): Date[] => {
|
|
10
|
-
const dropdownMonths: Date[] = [];
|
|
11
|
-
|
|
12
|
-
if (isSameYear(start, end)) {
|
|
13
|
-
const date = startOfMonth(start);
|
|
14
|
-
for (let month = start.getMonth(); month <= end.getMonth(); month++) {
|
|
15
|
-
dropdownMonths.push(setMonth(date, month));
|
|
16
|
-
}
|
|
17
|
-
} else if (isSameYear(current, end)) {
|
|
18
|
-
const date = startOfMonth(new Date());
|
|
19
|
-
for (let month = 0; month <= end.getMonth(); month++) {
|
|
20
|
-
dropdownMonths.push(setMonth(date, month));
|
|
21
|
-
}
|
|
22
|
-
} else if (isSameYear(current, start)) {
|
|
23
|
-
const date = startOfMonth(start);
|
|
24
|
-
for (let month = date.getMonth(); month <= 11; month++) {
|
|
25
|
-
dropdownMonths.push(setMonth(date, month));
|
|
26
|
-
}
|
|
27
|
-
} else {
|
|
28
|
-
const date = startOfMonth(new Date());
|
|
29
|
-
for (let month = 0; month <= 11; month++) {
|
|
30
|
-
dropdownMonths.push(setMonth(date, month));
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (!dropdownMonths.map((d) => d.getMonth()).includes(current.getMonth())) {
|
|
35
|
-
dropdownMonths.push(current);
|
|
36
|
-
}
|
|
37
|
-
dropdownMonths.sort((a, b) => a.getMonth() - b.getMonth());
|
|
38
|
-
|
|
39
|
-
return dropdownMonths;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const getYears = (
|
|
43
|
-
start: Date,
|
|
44
|
-
end: Date,
|
|
45
|
-
currentYear: number,
|
|
46
|
-
): Date[] => {
|
|
47
|
-
const years: Date[] = [];
|
|
48
|
-
const fromYear = start.getFullYear();
|
|
49
|
-
const toYear = end.getFullYear();
|
|
50
|
-
for (let year = fromYear; year <= toYear; year++) {
|
|
51
|
-
years.push(setYear(startOfYear(new Date()), year));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (fromYear > currentYear || toYear < currentYear) {
|
|
55
|
-
years.push(setYear(startOfYear(new Date()), currentYear));
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
years.sort((a, b) => a.getFullYear() - b.getFullYear());
|
|
59
|
-
return years;
|
|
60
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { startOfYear } from "date-fns";
|
|
2
|
-
import { DayPickerContextValue } from "react-day-picker";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
export function getInitialYear(context: Partial<DayPickerContextValue>): Date {
|
|
8
|
-
const { month, defaultMonth, toDate, fromDate } = context;
|
|
9
|
-
|
|
10
|
-
let initialMonth = month || defaultMonth || new Date();
|
|
11
|
-
|
|
12
|
-
const isAfter = toDate && toDate.getFullYear() < initialMonth.getFullYear();
|
|
13
|
-
|
|
14
|
-
const isBefore =
|
|
15
|
-
fromDate && fromDate.getFullYear() > initialMonth.getFullYear();
|
|
16
|
-
|
|
17
|
-
if (isAfter) {
|
|
18
|
-
initialMonth = toDate;
|
|
19
|
-
}
|
|
20
|
-
if (isBefore) {
|
|
21
|
-
initialMonth = fromDate;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return startOfYear(initialMonth);
|
|
25
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Locale,
|
|
3
|
-
addDays,
|
|
4
|
-
addWeeks,
|
|
5
|
-
differenceInCalendarDays,
|
|
6
|
-
endOfMonth,
|
|
7
|
-
endOfWeek,
|
|
8
|
-
getWeek,
|
|
9
|
-
getWeeksInMonth,
|
|
10
|
-
startOfMonth,
|
|
11
|
-
startOfWeek,
|
|
12
|
-
} from "date-fns";
|
|
13
|
-
|
|
14
|
-
export type MonthWeek = {
|
|
15
|
-
/** The week number from the start of the year. */
|
|
16
|
-
weekNumber: number;
|
|
17
|
-
/** The dates in the week. */
|
|
18
|
-
dates: Date[];
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export function getMonthWeeks(
|
|
22
|
-
month: Date,
|
|
23
|
-
options: {
|
|
24
|
-
locale: Locale;
|
|
25
|
-
useFixedWeeks?: boolean;
|
|
26
|
-
},
|
|
27
|
-
): MonthWeek[] {
|
|
28
|
-
const _options = {
|
|
29
|
-
...options,
|
|
30
|
-
weekStartsOn: 1 as const,
|
|
31
|
-
};
|
|
32
|
-
const weeksInMonth: MonthWeek[] = daysToMonthWeeks(
|
|
33
|
-
startOfMonth(month),
|
|
34
|
-
endOfMonth(month),
|
|
35
|
-
_options,
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
if (_options?.useFixedWeeks) {
|
|
39
|
-
// Add extra weeks to the month, up to 6 weeks
|
|
40
|
-
const nrOfMonthWeeks = getWeeksInMonth(month, _options);
|
|
41
|
-
if (nrOfMonthWeeks < 6) {
|
|
42
|
-
const lastWeek = weeksInMonth[weeksInMonth.length - 1];
|
|
43
|
-
const lastDate = lastWeek.dates[lastWeek.dates.length - 1];
|
|
44
|
-
const toDate = addWeeks(lastDate, 6 - nrOfMonthWeeks);
|
|
45
|
-
const extraWeeks = daysToMonthWeeks(
|
|
46
|
-
addWeeks(lastDate, 1),
|
|
47
|
-
toDate,
|
|
48
|
-
_options,
|
|
49
|
-
);
|
|
50
|
-
weeksInMonth.push(...extraWeeks);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return weeksInMonth;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/** Return the weeks between two dates. */
|
|
57
|
-
export function daysToMonthWeeks(
|
|
58
|
-
fromDate: Date,
|
|
59
|
-
toDate: Date,
|
|
60
|
-
options?: {
|
|
61
|
-
locale?: Locale;
|
|
62
|
-
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
63
|
-
},
|
|
64
|
-
): MonthWeek[] {
|
|
65
|
-
const toWeek = endOfWeek(toDate, options);
|
|
66
|
-
const fromWeek = startOfWeek(fromDate, options);
|
|
67
|
-
|
|
68
|
-
const nOfDays = differenceInCalendarDays(toWeek, fromWeek);
|
|
69
|
-
const days: Date[] = [];
|
|
70
|
-
|
|
71
|
-
for (let i = 0; i <= nOfDays; i++) {
|
|
72
|
-
days.push(addDays(fromWeek, i));
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const weeksInMonth = days.reduce((result: MonthWeek[], date) => {
|
|
76
|
-
const weekNumber = getWeek(date, options);
|
|
77
|
-
|
|
78
|
-
const existingWeek = result.find(
|
|
79
|
-
(value) => value.weekNumber === weekNumber,
|
|
80
|
-
);
|
|
81
|
-
if (existingWeek) {
|
|
82
|
-
existingWeek.dates.push(date);
|
|
83
|
-
return result;
|
|
84
|
-
}
|
|
85
|
-
result.push({
|
|
86
|
-
weekNumber,
|
|
87
|
-
dates: [date],
|
|
88
|
-
});
|
|
89
|
-
return result;
|
|
90
|
-
}, []);
|
|
91
|
-
|
|
92
|
-
return weeksInMonth;
|
|
93
|
-
}
|
package/src/date/utils/index.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export { formatDateForInput } from "./format-date";
|
|
2
|
-
export { getMonths, getYears } from "./get-dates";
|
|
3
|
-
export {
|
|
4
|
-
INPUT_DATE_STRING_FORMAT_DATE,
|
|
5
|
-
INPUT_DATE_STRING_FORMAT_MONTH,
|
|
6
|
-
parseDate,
|
|
7
|
-
} from "./parse-date";
|
|
8
|
-
export {
|
|
9
|
-
getLocaleFromString,
|
|
10
|
-
getTranslations,
|
|
11
|
-
getGlobalTranslations,
|
|
12
|
-
} from "./locale";
|
|
13
|
-
export { disableDate } from "./dates-disabled";
|
|
14
|
-
|
|
15
|
-
export { dateIsInCurrentMonth, isValidDate } from "./check-dates";
|
|
16
|
-
export { getInitialYear } from "./get-initial-year";
|
|
17
|
-
export { isMatch, isDateInRange, type Matcher } from "./is-match";
|
|
18
|
-
export { nextEnabled } from "./navigation";
|
|
File without changes
|
|
File without changes
|