1 | import { GenericDateConstructor } from "date-fns";
|
2 | import type {
|
3 | FormatOptions as DateFnsFormatOptions,
|
4 | Locale as DateFnsLocale
|
5 | } from "date-fns";
|
6 | import { addDays } from "date-fns/addDays";
|
7 | import { addMonths } from "date-fns/addMonths";
|
8 | import { addWeeks } from "date-fns/addWeeks";
|
9 | import { addYears } from "date-fns/addYears";
|
10 | import { differenceInCalendarDays } from "date-fns/differenceInCalendarDays";
|
11 | import { differenceInCalendarMonths } from "date-fns/differenceInCalendarMonths";
|
12 | import { endOfISOWeek } from "date-fns/endOfISOWeek";
|
13 | import { endOfMonth } from "date-fns/endOfMonth";
|
14 | import { endOfWeek } from "date-fns/endOfWeek";
|
15 | import { endOfYear } from "date-fns/endOfYear";
|
16 | import { format } from "date-fns/format";
|
17 | import { getISOWeek } from "date-fns/getISOWeek";
|
18 | import { getWeek } from "date-fns/getWeek";
|
19 | import { isAfter } from "date-fns/isAfter";
|
20 | import { isBefore } from "date-fns/isBefore";
|
21 | import { isDate } from "date-fns/isDate";
|
22 | import { isSameDay } from "date-fns/isSameDay";
|
23 | import { isSameMonth } from "date-fns/isSameMonth";
|
24 | import { isSameYear } from "date-fns/isSameYear";
|
25 | import { max } from "date-fns/max";
|
26 | import { min } from "date-fns/min";
|
27 | import { setMonth } from "date-fns/setMonth";
|
28 | import { setYear } from "date-fns/setYear";
|
29 | import { startOfDay } from "date-fns/startOfDay";
|
30 | import { startOfISOWeek } from "date-fns/startOfISOWeek";
|
31 | import { startOfMonth } from "date-fns/startOfMonth";
|
32 | import { startOfWeek } from "date-fns/startOfWeek";
|
33 | import { startOfYear } from "date-fns/startOfYear";
|
34 |
|
35 |
|
36 | export type FormatOptions = DateFnsFormatOptions;
|
37 |
|
38 |
|
39 | export type LabelOptions = DateFnsFormatOptions;
|
40 |
|
41 |
|
42 | export type Locale = DateFnsLocale;
|
43 |
|
44 | export type { Month as DateFnsMonth } from "date-fns";
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 | export const dateLib = {
|
53 |
|
54 | Date: Date as GenericDateConstructor,
|
55 | addDays,
|
56 | addMonths,
|
57 | addWeeks,
|
58 | addYears,
|
59 | differenceInCalendarDays,
|
60 | differenceInCalendarMonths,
|
61 | endOfISOWeek,
|
62 | endOfMonth,
|
63 | endOfWeek,
|
64 | endOfYear,
|
65 | format,
|
66 | getISOWeek,
|
67 | getWeek,
|
68 | isAfter,
|
69 | isBefore,
|
70 | isDate,
|
71 | isSameDay,
|
72 | isSameMonth,
|
73 | isSameYear,
|
74 | max,
|
75 | min,
|
76 | setMonth,
|
77 | setYear,
|
78 | startOfDay,
|
79 | startOfISOWeek,
|
80 | startOfMonth,
|
81 | startOfWeek,
|
82 | startOfYear
|
83 | };
|