Back to Element Plus

DatePickerPanel

docs/en-US/component/date-picker-panel.md

2.13.78.4 KB
Original Source

DatePickerPanel ^(beta)

DatePickerPanel is the core component of DatePicker.

Enter Date

Basic date picker measured by 'day'.

:::demo

date-picker-panel/basic

:::

Border

By default the date-picker-panel is bordered but in some case you don't want it. For example DatePicker don't inherit border.

:::demo

date-picker-panel/border

:::

Disabled

The disabled attribute determines if the date picker is fully disabled.

:::demo

date-picker-panel/disabled

:::

Types

The measurement is determined by the type attribute.

:::demo

date-picker-panel/all-types

:::

Localization

The default locale of is English, if you need to use other languages, please check Internationalization

Note, date time locale (month name, first day of the week ...) are also configured in localization.

API

Attributes

NameDescriptionTypeDefault
model-value / v-modelbinding value, if it is an range picker, the length of the array should be 2^[number] / ^[string] / ^[Date] / ^[array]number[] | string[] | Date[]''
borderwhether the date picker is bordered^[boolean]true
disabledwhether DatePicker is disabled^[boolean]false
clearablewhether to show clear button^[boolean]true
editable ^(2.13.0)whether the input is editable^[boolean]true
typetype of the picker^[enum]'year' | 'years' |'month' | 'months' | 'date' | 'dates' | 'datetime' | 'week' | 'datetimerange' | 'daterange' | 'monthrange' | 'yearrange'date
default-valueoptional, default date of the calendar^[object]Date | [Date, Date]
default-timeoptional, the time value to use when selecting date range^[object]Date | [Date, Date]
value-formatoptional, format of binding value. If not specified, the binding value will be a Date object^[string]
date-formatoptional, format of the date displayed in input's inner panel^[string] see date formatsYYYY-MM-DD
time-formatoptional, format of the time displayed in input's inner panel^[string] see date formatsHH:mm:ss
unlink-panelsunlink two date-panels in range-picker^[boolean]false
disabled-datea function determining if a date is disabled with that date as its parameter. Should return a Boolean^[Function](data: Date) => boolean
shortcutsan object array to set shortcut options^[array]Array<{ text: string, value: Date | Function }>[]
cell-class-nameset custom className^[Function](data: Date) => string
show-footerwhether to show footer where the date picker is one ^[enum]'dates' | 'months' | 'years' | 'datetime' | 'datetimerange'^[boolean]false
show-confirmwhether to show the confirm button^[boolean]false
show-week-numbershow the week number besides the week^[boolean]false

Events

NameDescriptionType
calendar-changetriggers when the calendar selected date is changed. Only for range^[Function](val: [Date, null | Date]) => void
panel-changetriggers when the navigation button click.^[Function](date: Date | [Date, Date], mode: 'month' | 'year', view?: string) => void
clear ^(2.13.1)triggers when a clear button is clicked^[Function]() => void

Slots

NameDescription
defaultcustom cell content
prev-monthprev month icon
next-monthnext month icon
prev-yearprev year icon
next-yearnext year icon