Skip to content

DatePicker

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

Basic

The basic usage of DatePicker.

YearPicker

The basic usage of the YearPicker.

MonthPicker

The basic usage of the MonthPicker.

QuarterPicker

The basic usage of QuarterPicker.

WeekPicker

The basic usage of WeekPicker.

RangePicker

The basic usage of RangePicker.

Date range

-

Week range

-

Month range

-

Quarter range

-

Year range

-

DateTime range

-

DatePicker showTime

Use showTime to select a date with time.

Show hours & minutes

Show hours & minutes & seconds

Time range

-

DefaultValue

DatePicker has a default value.

Date

Format date

DateTime

Week

Month

Year

DateRange

-

MonthRange

-

Disabled date

Use disabledDate to disable specified dates. And use disabledTime to disable time, which needs to be used with showTime.

Disabled date

Disabled dateRange

-

Disabled dateTime

Disabled dateTime range

-

Shortcuts

Use shortcuts to preset time for quick selection.

Date time

Month

Date time range

-

Month range

-

Custom shortcuts position

Use shortcutsPosition to place the shortcuts to the left, right or bottom.

Left

-

Right

-

Dynamic control range

According to the selected value to control the selected range, use onSelect and disabledDate.

Select the range of 7 days

-

Add an extra footer to meet the needs of some customized information.

-

Disabled

Disabled.

-
-
-

Customize cell

Use the named slot cell to customize the date cell.

V-model

Support two-way binding through v-model

Date value

DateRange value

-

Customize trigger element

Customize trigger element.

Panel Only

Only use panel, hide input selection.

2019-06
Sun
Mon
Tue
Wed
Thu
Fri
Sat
26
27
28
29
30
31
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
1
2
3
4
5
6
2019-08
Sun
Mon
Tue
Wed
Thu
Fri
Sat
28
29
30
31
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
7
2020-06
Sun
Mon
Tue
Wed
Thu
Fri
Sat
31
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
1
2
3
4
5
6
7
8
9
10
11

Sizes

Besides default size, tu-input component provides three additional sizes for you to choose among different scenarios. Use attribute size to set additional sizes with mini, small, large.

Date

DateTime

DateRange

-

Common API

Common Attributes

NameDescriptionTypeDefault
localeInternationalization configuration, used to cover the locale file in the datePicker fieldRecord-
hide-triggerThere is no trigger element, only the selection panel is displayedBooleanfalse
allow-clearWhether to allow clearBooleantrue
readonlyWhether it is read-onlyBooleanfalse
sizeThe size of the date pickerStringmedium
shortcutsQuick selection of preset time rangeArray[]
shortcuts-positionThe position of the preset range on the panel, which is placed at the bottom by default, and the side is generally used for scenes with a large number of preset timesStringbottom
positionThe position of the pop-up boxStringbl
popup-visibleControl the open or closed state of the pop-up boxBoolean-
default-popup-visibleThe default pop-up box is open or closedBooleanfalse
trigger-propsYou can pass in the parameters of the Trigger componentTriggerProps-
unmount-on-closeWhether to destroy the DOM structure when hidingBooleanfalse
placeholderPromptString-
disabledWhether to disableBooleanfalse
disabled-dateUnselectable dateFunction-
disabled-timeUnselectable timeFunction-
picker-value(v-model)Date displayed on the panelDateStringNumber-
default-picker-valueThe date displayed on the panel by defaultDateStringNumber-
popup-containerMount container for pop-up boxStringHTMLElementNullUndefined-
value-formatThe format of the value, valid for value / defaultValue / pickerValue / defaultPickerValue and the return value in the event, supports setting as timestamp, Date and string (refer to String parsing format ). If not specified, it will be formatted as a string, in the same format as format.TimestampDateString-
preview-shortcutWhether to preview the result of the shortcutBooleantrue
show-confirm-btnWhether to show the confirm button, always show when showTime is true.Booleanfalse
disabled-inputWhether input is disabled with the keyboard.Booleanfalse
abbreviationWhether to enable abbreviationBooleantrue

Common Events

NameDescriptionType
changeThe component value changesFunction
selectThe selected date has changed but the component value has not changedFunction
popup-visible-changeOpen or close the pop-up boxFunction
okClick the confirm buttonFunction
clearClick the clear buttonFunction
select-shortcutClick on the shortcut optionFunction
picker-value-changePanel date changeFunction

Date-Picker Attributes

NameDescription
prefixInput box prefix
suffix-iconInput box suffix icon
icon-next-doubleDouble arrow page backward icon
icon-prev-doubleDouble arrow page forward icon
icon-nextSingle arrow page backward icon
icon-prevSingle arrow page forward icon
cellCustomize the contents of the date cell
extraExtra footer

Week-Picker Attributes

NameDescriptionTypeDefault
v-modelValueDateStringNumber-
default-valueDefault valueDateStringNumber-
formatDisplay the format of the date, refer to String Parsing FormatStringgggg-wo
value-formatThe format of the value, valid for value / defaultValue / pickerValue / defaultPickerValue and the return value in the event, supports setting as timestamp, Date and string(refer toString parsing format).StringYYYY-MM-DD
day-start-of-weekThe first day of the week starts on the day of the week, 0-Sunday, 1-Monday, and so on.Number0

Quarter-Picker Attributes

NameDescriptionTypeDefault
v-modelValueDateStringNumber-
default-valueDefault valueDateStringNumber-
formatDisplay the format of the date, refer to String parsing formatStringYYYY-MM
value-formatThe format of the value, valid for value / defaultValue / pickerValue / defaultPickerValue and the return value in the event, supports setting as timestamp, Date and string (refer to String parsing format).StringYYYY-MM

Month-Picker Attributes

NameDescriptionTypeDefault
model-value / v-modelValueDateStringNumber-
default-valueDefault valueDateStringNumber-
formatDisplay the format of the date, refer to String parsing formatStringYYYY-MM

Year-Picker Attributes

NameDescriptionTypeDefault
model-value / v-modelValueDateStringNumber-
default-valueDefault valueDateStringNumber-
formatDisplay the format of the date, refer to String parsing formatStringYYYY

Range-Picker Attributes

NameDescriptionTypeDefault
modeType of range selectorStringdate
v-modelValueArray-
default-valueDefault valueArray-
picker-valueThe date displayed in the default panelArray-
default-picker-valueDate displayed on the panelArray-
disabledWhether to disableBooleanArrayfalse
day-start-of-weekThe first day of the week starts on the day of the week, 0-Sunday, 1-Monday, and so on.Number0
formatDisplay the format of the date, refer to String parsing formatString-
value-formatThe format of the value, valid for value defaultValue pickerValue defaultPickerValue and the return value in the event, supports setting as timestamp, Date and string (refer to String parsing format). if not specified, it will be formatted as a string, in the same format as format.TimestampDateString-
show-timeWhether to increase time selectionBooleanfalse
time-picker-propsTime display parametersObject-
placeholderPromptArray-
disabled-dateUnselectable dateFunction-
disabled-timeUnselectable timeFunction-
separatorThe segmentation symbol in the input box of the range selectorString-
exchange-timeWhether the time will be exchanged, by default time will affect and participate in the ordering of start and end values, if you want to fix the time order, you can turn it off.Stringtrue
disabled-inputWhether input is disabled with the keyboard.Booleanfalse
abbreviationWhether to enable abbreviationBooleantrue

Range-Picker Events

NameDescriptionType
changeThe component value changes.Function
selectThe selected date has changed but the component value has not changed.Function
popup-visible-changeOpen or close the pop-up boxFunction
okClick the confirm buttonFunction
clearClick the clear buttonFunction
select-shortcutClick on the shortcut optionFunction
picker-value-changePanel date changeFunction

ShortcutType

NameDescriptionTypeDefault
labelThe content of shortcutStringNumberFunction-
valueThe value of shortcutDateStringNumberArrayFunction-
formatThe format use to parse value, refer to String parsing formatString-

String parsing format

FormatOutputDescription
YY21Two-digit year
YYYY2021Four-digit year
M1-12Month, starting from 1
MM01-12Month, two digits
MMMJan-DecAbbreviated month name
MMMMJanuary-DecemberFull month name
D1-31Day of the month
DD01-31Day of the month, two digits
d0-6Day of the week, Sunday is 0
ddSu-SaThe shortest name of the day of the week
dddSun-SatAbbreviated name of the day of the week
ddddSunday-SaturdayThe name of the day of the week
H0-23Hour
HH00-23Hour, two digits
h1-12Hour, 12-hour clock
hh01-12Hour, 12-hour clock, two digits
m0-59Minute
mm00-59Minute, two digits
s0-59Second
ss00-59Second, two digits
S0-9Hundreds of milliseconds, one digits
SS00-99Tens of milliseconds, two digits
SSS000-999Millisecond, three digits
Z-5:00UTC offset
ZZ-0500UTC offset, add 0 in front of the number
AAM PM-
aam pm-
Do1st... 3stDay of month with serial number
X1410715640.579Unix timestamp
x1410715640579Unix millisecond timestamp