naive-ui/demo/documentation/components/datePicker/enUS/index.md
2020-01-28 22:08:25 +08:00

2.2 KiB

DatePicker

People has too many ideas about how to set a time.

Demos

date
datetime
daterange
datetimerange
disabled
disabledTime
actions
events

V-model

Prop Event
value change

Props

Name Type Default Description
value number null
actions Array<'clear' | 'now' | 'confirm'> null
disabled boolean false
type 'date' | 'datetime' | 'daterange' |'datetimerange' 'date

Date

Name Type Default Description
placeholder string 'Select Date'
is-date-disabled (current: number) => boolean () => false

DateTime

Name Type Default Description
placeholder string 'Select Date and Time'
is-date-disabled (current: number) => boolean () => false
is-time-disabled (current: number) => { isHourDisabled: boolean, isMinuteDisabled: boolean, isSecondDisabled: boolean } () => ({ isHourDisabled: () => false, isMinuteDisabled: () => false, isSecondDisabled: () => false }})

DateRange

Name Type Default Description
seperator string 'to'
start-placeholder string 'Start Date and Time
end-placeholder string End Date and Time
is-date-disabled (current: number) => boolean () => false
is-time-disabled (current: number) => { isHourDisabled: boolean, isMinuteDisabled: boolean, isSecondDisabled: boolean } () => ({ isHourDisabled: () => false, isMinuteDisabled: () => false, isSecondDisabled: () => false }})

DateTimeRange

Name Type Default Description
seperator string 'to'
start-placeholder string 'Start Date and Time
end-placeholder string End Date and Time
is-date-disabled (current: number) => boolean () => false
is-time-disabled (current: number) => { isHourDisabled: boolean, isMinuteDisabled: boolean, isSecondDisabled: boolean } () => ({ isHourDisabled: () => false, isMinuteDisabled: () => false, isSecondDisabled: () => false }})

Events

Date, DateTime

Name Parameters Description
change (currentValue: number | null)
blur (currentValue: number | null)

DateRange, DateTimeRange

Name Parameters Description
change (currentValue: [number, number] | null)
blur (currentValue: [number, number] | null)