[@types/react-datepicker] AUdate type for locale (#36904)

This commit is contained in:
Naoki Sekiguchi
2019-07-16 14:00:00 -07:00
committed by Andrew Branch
parent 61a2812858
commit 4477702e07
3 changed files with 8 additions and 3 deletions
+4 -2
View File
@@ -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;
+2 -1
View File
@@ -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}
/>;