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