-
Notifications
You must be signed in to change notification settings - Fork 843
/
Copy pathreact-datepicker.d.ts
184 lines (165 loc) Β· 4.99 KB
/
react-datepicker.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
// Type definitions for react-datepicker 1.8
// Project: https://github.com/Hacker0x01/react-datepicker
// Definitions by: Rajab Shakirov <https://github.com/radziksh>,
// Andrey Balokha <https://github.com/andrewBalekha>,
// Greg Smith <https://github.com/smrq>,
// Platon Pronko <https://github.com/Rogach>
// Roy Xue <https://github.com/royxue>
// Koala Human <https://github.com/KoalaHuman>
// Sean Kelley <https://github.com/seansfkelley>
// Justin Grant <https://github.com/justingrant>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import * as React from 'react';
import * as moment from 'moment';
export interface ReactDatePickerProps {
/**
* Whether changes to Year and Month (via dropdowns) should trigger `onChange`
*/
adjustDateOnChange?: boolean;
accessibleMode?: boolean;
allowSameDay?: boolean;
autoComplete?: string;
autoFocus?: boolean;
/**
* Optional class added to the calendar portion of datepicker
*/
calendarClassName?: string;
children?: React.ReactNode;
/**
* Added to the actual input of the calendar
*/
className?: string;
/**
* Replaces the input with any node, like a button
*/
customInput?: React.ReactNode;
customInputRef?: string;
/**
* Accepts any moment format string
*/
dateFormat?: string | string[];
dateFormatCalendar?: string;
dayClassName?(date: moment.Moment): string | null;
disabled?: boolean;
disabledKeyboardNavigation?: boolean;
dropdownMode?: 'scroll' | 'select';
endDate?: moment.Moment;
excludeDates?: moment.Moment[];
excludeTimes?: moment.Moment[];
filterDate?(date: moment.Moment): boolean;
fixedHeight?: boolean;
forceShowMonthNavigation?: boolean;
formatWeekNumber?(date: moment.Moment): string | number;
highlightDates?: moment.Moment[];
id?: string;
includeDates?: moment.Moment[];
includeTimes?: moment.Moment[];
inline?: boolean;
/**
* Adds additional times to the time selector other then :30 increments
*/
injectTimes?: moment.Moment[];
isClearable?: boolean;
/**
* Switches the locale / display. "en-us", "zn-ch"...etc
*/
locale?: moment.LocaleSpecifier;
/**
* The max date accepted (in moment format) as a selection
*/
maxDate?: moment.Moment;
/**
* The max time accepted (in moment format) as a selection
*/
maxTime?: moment.Moment;
/**
* The min date accepted (in moment format) as a selection
*/
minDate?: moment.Moment;
/**
* The min time accepted (in moment format) as a selection
*/
minTime?: moment.Moment;
monthsShown?: number;
name?: string;
onBlur?(event: React.FocusEvent<HTMLInputElement>): void;
/**
* What to do when the input changes
*/
onChange?(
date: moment.Moment | null,
event?: React.SyntheticEvent<any>
): void;
onChangeRaw?(event: React.FocusEvent<HTMLInputElement>): void;
onClickOutside?(event: React.MouseEvent<HTMLDivElement>): void;
onFocus?(event: React.FocusEvent<HTMLInputElement>): void;
onKeyDown?(event: React.KeyboardEvent<HTMLDivElement>): void;
onMonthChange?(date: moment.Moment): void;
onSelect?(date: moment.Moment, event?: React.SyntheticEvent<any>): void;
onWeekSelect?(
firstDayOfWeek: moment.Moment,
weekNumber: string | number,
event?: React.SyntheticEvent<any>
): void;
onYearChange?(date: moment.Moment): void;
openToDate?: moment.Moment;
peekNextMonth?: boolean;
placeholderText?: string;
/**
* Class applied to the popup, when inline is false
*/
popperClassName?: string;
popperContainer?(props: { children: React.ReactNode[] }): React.ReactNode;
popperPlacement?: string;
preventOpenOnFocus?: boolean;
readOnly?: boolean;
required?: boolean;
scrollableMonthYearDropdown?: boolean;
scrollableYearDropdown?: boolean;
/**
* The selected datetime (in moment format)
*/
selected?: moment.Moment | null;
selectsEnd?: boolean;
selectsStart?: boolean;
/**
* Will close the popup on selection
*/
shouldCloseOnSelect?: boolean;
showDisabledMonthNavigation?: boolean;
showMonthDropdown?: boolean;
showMonthYearDropdown?: boolean;
/**
* Show the time selection alongside the calendar
*/
showTimeSelect?: boolean;
/**
* Only show the time selector, not the calendar
*/
showTimeSelectOnly?: boolean;
showWeekNumbers?: boolean;
showYearDropdown?: boolean;
startDate?: moment.Moment;
startOpen?: boolean;
tabIndex?: number;
timeCaption?: string;
/**
* The format of the time within the selector, in moment notation
*/
timeFormat?: string;
timeIntervals?: number;
title?: string;
todayButton?: string;
useShortMonthInDropdown?: boolean;
useWeekdaysShort?: boolean;
utcOffset?: number;
value?: string;
weekLabel?: string;
withPortal?: boolean;
yearDropdownItemNumber?: number;
}
declare const ReactDatePicker: React.ClassicComponentClass<
ReactDatePickerProps
>;
export default ReactDatePicker;