Skip to content

TimePicker

Basic usage

Disabled

Set the value of disabled in dd-time-picker to true to disable this option.

Size

Interval Option

Show stepped options by hourStep minuteStep secondStep

Addon

renderExtraFooter Slot

Time Range Picker

Bordered-less

Bordered-less style component.

TimePicker API

TimePicker Attributes

NameDescriptionTypeDefaultVersion
value(v-model)binding valuedayjs
open(v-model)Whether to popup panelbooleanfalse
placeholderplaceholderstring | [string, string]Select a time
disableddisabledbooleanfalse
disabledTimedisabledTimeDisabledTime
hideDisabledOptionsWhether hide the options that can not be selectedbooleanfalse
sizesizelarge | default | small
readonlyreadonlybooleanfalse
clearablecan be clearedbooleanfalse
borderedBordered-lessbooleanfalse
showNowWhether to show Now button on panelbooleantrue
formatTo set the time formatstringHH:mm:ss
valueFormatformat of binding valuestring date formatsHH:mm:ss
hourStepInterval between hours in pickernumber1
minuteStepInterval between minutes in pickernumber1
secondStepInterval between seconds in pickernumber1

DisabledTime

typescript
type DisabledTime = (now: Dayjs) => {
	disabledHours?: () => number[];
	disabledMinutes?: (selectedHour: number) => number[];
	disabledSeconds?: (selectedHour: number, selectedMinute: number) => number[];
};

TimePicker Events

NameDescriptionType
changea callback function, can be executed when the selected time is changing(time: dayjs | string) => void
openChangea callback function which will be called while panel opening/closing(open: boolean) => void

TimePicker Slots

NameDescription
renderExtraFooterCalled from time picker panel to render some addon to its bottom
suffixIconThe custom suffix icon

TimeRangePicker API

TimeRangePicker Attributes

Same props from TimePicker. And includes additional props:

NameDescriptionTypeDefaultVersion
orderOrder start and end timebooleantrue

Contributors

lazy

ChangeLog

f41a0 - fix: 修复时间选择器点击无反应 on 12/9/2024
56bb7 - fix: 修复TimeRangePicker样式问题 on 1/19/2024
33fd8 - style: 调整样式 on 1/2/2024
3ddb6 - fix: 修复无日期时时间无效 on 1/2/2024
9eadc - feat: readonly attribute on 12/29/2023
b3bb3 - style: 修改滚动条样式 on 12/27/2023
e1b61 - style: time抽离样式 on 12/26/2023
01f58 - fix: 修正disabledTime on 12/26/2023
23659 - feat: time-picker on 12/21/2023

Released under the MIT License.