mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 15:27:05 +00:00
[@types/react-datepicker] AUdate type for locale (#36904)
This commit is contained in:
committed by
Andrew Branch
parent
61a2812858
commit
4477702e07
Vendored
+4
-2
@@ -1,4 +1,4 @@
|
||||
// Type definitions for react-datepicker 2.3
|
||||
// Type definitions for react-datepicker 2.8
|
||||
// Project: https://github.com/Hacker0x01/react-datepicker
|
||||
// Definitions by: Rajab Shakirov <https://github.com/radziksh>,
|
||||
// Andrey Balokha <https://github.com/andrewBalekha>,
|
||||
@@ -11,11 +11,13 @@
|
||||
// Jake Boone <https://github.com/jakeboone02>
|
||||
// Roman Nuritdinov <https://github.com/Ky6uk>
|
||||
// Avi Klaiman <https://github.com/aviklai>
|
||||
// Naoki Sekiguchi <https://github.com/seckie>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from "react";
|
||||
import * as Popper from "popper.js";
|
||||
import { Locale } from 'date-fns';
|
||||
|
||||
export function registerLocale(localeName: string, localeData: {}): void;
|
||||
export function setDefaultLocale(localeName: string): void;
|
||||
@@ -58,7 +60,7 @@ export interface ReactDatePickerProps {
|
||||
injectTimes?: Date[];
|
||||
inline?: boolean;
|
||||
isClearable?: boolean;
|
||||
locale?: string;
|
||||
locale?: string | Locale;
|
||||
maxDate?: Date | null;
|
||||
maxTime?: Date;
|
||||
minDate?: Date | null;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"popper.js": "^1.14.1"
|
||||
"popper.js": "^1.14.1",
|
||||
"date-fns": "^2.0.0-beta.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import DatePicker, {
|
||||
setDefaultLocale,
|
||||
getDefaultLocale,
|
||||
} from 'react-datepicker';
|
||||
import * as enUS from 'date-fns/locale/en-US';
|
||||
|
||||
registerLocale('en-GB', { options: { weekStartsOn: 1 } });
|
||||
setDefaultLocale('en-GB');
|
||||
@@ -131,6 +132,7 @@ const defaultLocale = getDefaultLocale();
|
||||
maxDate={null}
|
||||
startDate={null}
|
||||
endDate={null}
|
||||
locale={enUS}
|
||||
onChange={() => null}
|
||||
/>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user