Skip to main content

DatePicker

To select or input a date.

When To Use#

By clicking the input box, you can select a date from a popup calendar.

Examples#

import { DatePicker, RangeDatePicker } from 'tailor-ui';

Date picker#

Basic usage#

Controlled usage#



allowClear#



Choose Time#

Choose Time & with minute step#

Disabled Specified Date#

Ranger picker#

Basic usage#

~


~

With time picker#

~

allowClear#

~


~

Calendar usage#

SuMoTuWeThFrSa
26
27
28
29
30
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
1
2
3
4
5
6

API#

Common API#

PropertyDescriptionTypeDefault
allowClearWhether to show clear buttonbooleanfalse
showTimeto provide an additional time selectionboolean \| ShowTime Optionsfalse
disabledDatespecify the date that cannot be selected(current: Date) => boolean
disabledTimeto specify the time that cannot be selected(current: Date, type: 'start' \| 'end') => boolean
placeholderplaceholder of date inputstring

ShowTime Options#

PropertyDescriptionTypeDefault
showHourwhether show hourBooleantrue
showMinutewhether show minuteBooleantrue
showSecondwhether show secondBooleantrue
use12Hours12 hours display modeBooleanfalse
hourStepinterval between hours in pickerNumber1
minuteStepinterval between minutes in pickerNumber1
secondStepinterval between seconds in pickerNumber1
hideDisabledOptionswhether hide disabled optionsBooleanfalse

DatePicker#

PropertyDescriptionTypeDefault
valueto set dateDate
defaultValueto set default date, if start time or end time is null or undefined, the date range will be an open intervalDate
onChangea callback function, can be executed when the selected time is changing(date: Date \| null, dateStrings: [string, string]) => void

RangeDatePicker#

PropertyDescriptionTypeDefault
valueto set date[Date, Date]
defaultValueto set default date, if start time or end time is null or undefined, the date range will be an open interval[Date, Date]
onChangea callback function, can be executed when the selected time is changing(date: [Date, Date] \| null) => void
rangespreseted ranges for quick selection{ String \| [range: string]: [Date, Date] } \| { [range: string]: () => [Date, Date] }