Skip to content

TimePicker

Use Time Picker for time input.

Basic Usage

The basic usage of TimePicker.

Range Picker

Select time range.

~

V-model

Support v-model for two-way data binding.

Allow Clear

By setting allow-clear, the clear button is displayed.

~

Default Value

The default value can be passed through defaultValue.

~

Disabled

Disabled.

~

Disable Option

By setting disabledHours disabledMinutes disabledSeconds, you can disable some options of hour/minute/second.

~

Skip Confirm

Skip the confirm step and click directly to select time.

~

Custom Format

By setting format, you can customize the hour, minute, and second.

~

Step

By setting step, you can customize the step length of the hour, minute, and second.

Extra Content

Show extra content.

Use 12 Hours

By setting use12Hours, you can customize the hours, minutes, and seconds.

~

Sizes

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

时间选择

时间范围选择

~
~
~
~

Time-Picker API

Time-Picker Attributes

NameDescriptionTypeDefault
typeSelector typeStringtime
model-value / v-modelValueString Number Date Array-
default-valuedefault ValueString Number Date Array-
disabledWhether to disableBooleanfalse
allow-clearWhether to allow clearBooleanfalse
readonlyWhether it is read-only modeBooleanfalse
formatDisplay the format of the date, refer toString Parsing FormatStringHH:mm:ss
placeholderPlaceholderString-
sizeInput box sizeStringmedium
popup-containerMount container for pop-up boxString HTMLElement-
use12-hours12 hour clockBooleanfalse
stepSet the hour/minute/second selection intervalObject-
disabled-hoursDisabled partial hour optionsFunction-
disabled-minutesDisabled some minutes optionsFunction-
disabled-secondsDisabled partial seconds optionFunction-
hide-disabled-optionsHide disabled optionsBooleanfalse
disable-confirmFirmation step, click the time directly after opening, without clicking the confirmation buttonBooleanfalse
positionPop-up positionStringbl
popup-visibleControl the pop-up box to open or closeBoolean-
default-popup-visibleThe pop-up box is opened or closed by defaultBooleanfalse
trigger-propsYou can pass in the parameters of the Trigger componentTriggerProps-
unmount-on-closeWhether to destroy the dom structure after closingBooleanfalse

Time-Picker Events

NameDescriptionType
changeThe component value changesFunction
selectSelect time but do not trigger component value changeFunction
clearClick the clear button-
popup-visible-changePop up box expand and collapseFunction

Time-Picker Slots

NameDescription
prefixInput box prefix
suffix-iconInput box suffix icon
extraExtra footer

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
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