diff --git a/types/flatpickr/index.d.ts b/types/flatpickr/index.d.ts index 535ec0145e..fce4214c90 100644 --- a/types/flatpickr/index.d.ts +++ b/types/flatpickr/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/chmln/flatpickr // Definitions by: James Birtles // Rowell Heria +// Michael Wagner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare function flatpickr(element: string | Element | HTMLElement, options?: Flatpickr.Options): Flatpickr; @@ -21,6 +22,11 @@ declare class Flatpickr { set(option: string, value: any): void; setDate(date: Flatpickr.DateString | Flatpickr.DateString[], triggerChange?: boolean, dateFormat?: string): void; toggle(): void; + + static localize(locale: string | Flatpickr.Locale): void; + static l10ns: { + default: Flatpickr.Locale; + }; } declare namespace Flatpickr { @@ -63,6 +69,30 @@ declare namespace Flatpickr { utc?: boolean; weekNumbers?: boolean; wrap?: boolean; + locale?: string | Locale; + } + + interface Locale { + weekdays?: { + shorthand?: string[]; + longhand?: string[]; + }; + + months?: { + shorthand?: string[]; + longhand?: string[]; + }; + + firstDayOfWeek?: number; + weekAbbreviation?: string; + rangeSeparator?: string; + am?: string; + pm?: string; + + ordinal?: ((nth: number) => string) | string; + + scrollTitle?: string; + toggleTitle?: string; } type DateString = Date | string;