1 | import { IUtils, DateIOFormats, Unit } from "@date-io/core/IUtils";
|
2 | import { enUS as defaultLocale } from "date-fns/locale/en-US";
|
3 | type Locale = typeof defaultLocale;
|
4 | export default class DateFnsUtils implements IUtils<Date, Locale> {
|
5 | lib: string;
|
6 | locale?: Locale;
|
7 | formats: DateIOFormats;
|
8 | constructor({ locale, formats, }?: {
|
9 | formats?: Partial<DateIOFormats>;
|
10 | locale?: Locale;
|
11 | instance?: any;
|
12 | });
|
13 | is12HourCycleInCurrentLocale: () => boolean;
|
14 | getFormatHelperText: (format: string) => string;
|
15 | parseISO: (isoString: string) => Date;
|
16 | toISO: (value: Date) => string;
|
17 | getCurrentLocaleCode: () => string;
|
18 | addSeconds: (value: Date, count: number) => Date;
|
19 | addMinutes: (value: Date, count: number) => Date;
|
20 | addHours: (value: Date, count: number) => Date;
|
21 | addDays: (value: Date, count: number) => Date;
|
22 | addWeeks: (value: Date, count: number) => Date;
|
23 | addMonths: (value: Date, count: number) => Date;
|
24 | addYears: (value: Date, count: number) => Date;
|
25 | isValid: (value: any) => boolean;
|
26 | getDiff: (value: Date, comparing: Date | string, unit?: Unit) => number;
|
27 | isAfter: (value: Date, comparing: Date) => boolean;
|
28 | isBefore: (value: Date, comparing: Date) => boolean;
|
29 | startOfDay: (value: Date) => Date;
|
30 | endOfDay: (value: Date) => Date;
|
31 | getHours: (value: Date) => number;
|
32 | setHours: (value: Date, count: number) => Date;
|
33 | setMinutes: (value: Date, count: number) => Date;
|
34 | getSeconds: (value: Date) => number;
|
35 | setSeconds: (value: Date, count: number) => Date;
|
36 | isSameDay: (value: Date, comparing: Date) => boolean;
|
37 | isSameMonth: (value: Date, comparing: Date) => boolean;
|
38 | isSameYear: (value: Date, comparing: Date) => boolean;
|
39 | isSameHour: (value: Date, comparing: Date) => boolean;
|
40 | startOfYear: (value: Date) => Date;
|
41 | endOfYear: (value: Date) => Date;
|
42 | startOfMonth: (value: Date) => Date;
|
43 | endOfMonth: (value: Date) => Date;
|
44 | startOfWeek: (value: Date) => Date;
|
45 | endOfWeek: (value: Date) => Date;
|
46 | getYear: (value: Date) => number;
|
47 | setYear: (value: Date, count: number) => Date;
|
48 | date<TArg extends unknown = undefined, TRes extends unknown = TArg extends null ? null : TArg extends undefined ? Date : Date | null>(value?: TArg): TRes;
|
49 | toJsDate: (value: Date) => Date;
|
50 | parse: (value: string, formatString: string) => Date | null;
|
51 | format: (date: Date, formatKey: keyof DateIOFormats) => string;
|
52 | formatByString: (date: Date, formatString: string) => string;
|
53 | isEqual: (date: any, comparing: any) => boolean;
|
54 | isNull: (date: Date) => boolean;
|
55 | isAfterDay: (date: Date, value: Date) => boolean;
|
56 | isBeforeDay: (date: Date, value: Date) => boolean;
|
57 | isBeforeYear: (date: Date, value: Date) => boolean;
|
58 | isBeforeMonth(value: Date, comparing: Date): boolean;
|
59 | isAfterMonth(value: Date, comparing: Date): boolean;
|
60 | isAfterYear: (date: Date, value: Date) => boolean;
|
61 | isWithinRange: (date: Date, [start, end]: [Date, Date]) => boolean;
|
62 | formatNumber: (numberToFormat: string) => string;
|
63 | getMinutes: (date: Date) => number;
|
64 | getDate: (date: Date) => number;
|
65 | setDate: (date: Date, count: number) => Date;
|
66 | getMonth: (date: Date) => number;
|
67 | getDaysInMonth: (date: Date) => number;
|
68 | setMonth: (date: Date, count: number) => Date;
|
69 | getMeridiemText: (ampm: "am" | "pm") => "AM" | "PM";
|
70 | getNextMonth: (date: Date) => Date;
|
71 | getPreviousMonth: (date: Date) => Date;
|
72 | getMonthArray: (date: Date) => Date[];
|
73 | mergeDateAndTime: (date: Date, time: Date) => Date;
|
74 | getWeekdays: () => string[];
|
75 | getWeekArray: (date: Date) => Date[][];
|
76 | getYearRange: (start: Date, end: Date) => Date[];
|
77 | }
|
78 | export {};
|