import{_ as E,a as c,b as l,c as u}from"./chunks/default-time.3448ba9f.js";import{c as D,a as t,w as p,u as e,e as o,b as a,d as C,r as k,o as i}from"./app.fbbef7af.js";const r=o('
Select date and time in one picker.
TIP
DateTimePicker is derived from DatePicker and TimePicker. For a more detailed explanation on attributes, you can refer to DatePicker and TimePicker.
Use format
to control displayed text's format in the input box. Use value-format
to control binding value's format.
By default, the component accepts and emits a Date
object.
Check the list here of all available formats of Day.js.
WARNING
Pay attention to capitalization
Attribute | Description | Type | Accepted Values | Default |
---|---|---|---|---|
model-value / v-model | binding value | date(DateTimePicker) / array(DateTimeRangePicker) | \u2014 | \u2014 |
readonly | whether DatePicker is read only | boolean | \u2014 | false |
disabled | whether DatePicker is disabled | boolean | \u2014 | false |
editable | whether the input is editable | boolean | \u2014 | true |
clearable | whether to show clear button | boolean | \u2014 | true |
size | size of Input | string | large/default/small | default |
placeholder | placeholder in non-range mode | string | \u2014 | \u2014 |
start-placeholder | placeholder for the start date in range mode | string | \u2014 | \u2014 |
end-placeholder | placeholder for the end date in range mode | string | \u2014 | \u2014 |
time-arrow-control | whether to pick time using arrow buttons | boolean | \u2014 | false |
type | type of the picker | string | year/month/date/datetime/ week/datetimerange/daterange | date |
format | format of the displayed value in the input box | string | see date formats | YYYY-MM-DD HH:mm:ss |
popper-class | custom class name for DateTimePicker's dropdown | string | \u2014 | \u2014 |
range-separator | range separator | string | - | '-' |
default-value | optional, default date of the calendar | Date | anything accepted by new Date() | \u2014 |
default-time | the default time value after picking a date | non-range: Date / range: Date[] | non-range: a Date object, range: array of two Date objects, and the first item is for the start date and second for the end date. Time 00:00:00 will be used if not specified | \u2014 |
value-format | optional, format of binding value. If not specified, the binding value will be a Date object | string | see date formats | \u2014 |
id | same as id in native input | string / array(string) | String id="my-datetime" or array :id="['my-range-start', 'my-range-end']" for date range | - |
name | same as name in native input | string | \u2014 | \u2014 |
unlink-panels | unllink two date-panels in range-picker | boolean | \u2014 | false |
prefix-icon | Custom prefix icon component | string / Component | \u2014 | Date |
clear-icon | Custom clear icon component | string / Component | \u2014 | CircleClose |
shortcuts | an object array to set shortcut options | object[{ text: string, value: date / function }] | \u2014 | \u2014 |
disabledDate | a function determining if a date is disabled with that date as its parameter. Should return a Boolean | function | \u2014 | \u2014 |
cellClassName | set custom className | Function(Date) | \u2014 | \u2014 |
teleported | whether datetime-picker dropdown is teleported to the body | boolean | true / false | true |
Event Name | Description | Parameters |
---|---|---|
change | triggers when user confirms the value | component's binding value |
blur | triggers when Input blurs | component instance |
focus | triggers when Input focuses | component instance |
calendar-change | triggers when the calendar selected date is changed. Only for datetimerange | [Date, Date] |
visible-change | triggers when the DateTimePicker's dropdown appears/disappears | true when it appears, and false otherwise |
Method | Description | Parameters |
---|---|---|
focus | focus the Input component | \u2014 |
Name | Description |
---|---|
default | custom cell content |
range-separator | custom range separator content |