Datetimepicker
An input with a simple dropdown/modal for selecting a date and time, uses native datetimepicker for mobile
Class props
Datetimepicker component
An input with a simple dropdown/modal for selecting a date and time, uses native datetimepicker for mobile
html
<o-datetimepicker></o-datetimepicker>
Props
Prop name | Description | Type | Values | Default |
---|---|---|---|---|
active | The active state of the dropdown, use v-model:active to make it two-way binding | boolean | - | false |
customValidity | Custom HTML 5 validation error to set on the form control | string | ((currentValue: Date, state: ValidityState) => string) | - | "" |
datepicker | Define props for the underlying datepicker component | any | - | |
datetimeCreator | Date creator function, default is new Date() | (date: Date) => Date | - | From config: datetimepicker: { |
datetimeFormatter | Custom function to format a date into a string | (date: Date) => string | - | From config: datetimepicker: { |
datetimeParser | Custom function to parse a string into a date | (date: string) => Date | - | From config: datetimepicker: { |
disabled | Same as native disabled | boolean | - | false |
expanded | boolean | - | false | |
icon | Icon to be shown | string | - | From config: datetimepicker: { |
iconPack | Icon pack to use | string | mdi , fa , fas and any other custom icon pack | From config: datetimepicker: { |
iconRight | Icon to be added on the right side | string | - | From config: datetimepicker: { |
iconRightClickable | Make the icon right clickable | boolean | - | false |
inline | Display datetimepicker inline | boolean | - | false |
locale | Date format locale | string | - | From config: { |
maxDatetime | Max date to select | Date | - | |
minDatetime | Min date to select | Date | - | |
mobileNative | Enable mobile native input if mobile agent | boolean | - | From config: datetimepicker: { |
v-model | The input value state | Date | - | null |
openOnFocus | Open dropdown on focus | boolean | - | From config: datetimepicker: { |
override | Override existing theme classes completely | boolean | - | |
placeholder | Input placeholder | string | - | |
position | Dropdown position | string | - | |
readonly | Same as native input readonly | boolean | - | false |
rounded | Makes the input rounded | boolean | - | false |
size | Size of the input control | string | small , medium , large | From config: datetimepicker: { |
teleport | Append the component to another part of the DOM. Set true to append the component to the body.In addition, any CSS selector string or an actual DOM node can be used. | string | boolean | Record<string, any> | - | From config: datetimepicker: { |
timepicker | Define props for the underlying timepicker component | any | - | |
useHtml5Validation | Enable HTML 5 native validation | boolean | - | From config: { |
Events
Event name | Properties | Description |
---|---|---|
change-month | value number - month number | on month change event |
change-year | value number - year number | on year change event |
icon-click | event Event - native event | on icon click event |
icon-right-click | event Event - native event | on icon right click event |
update:modelValue | value Date | Date[] - updated modelValue prop | modelValue prop two-way binding |
update:active | value boolean - updated active prop | active prop two-way binding |
range-start | value Date - range start date | on range start is selected event |
range-end | value Date - range end date | on range end is selected event |
focus | event Event - native event | on input focus event |
blur | event Event - native event | on input blur event |
invalid | event Event - native event | on input invalid event |
Slots
Name | Description | Bindings |
---|---|---|
footer | Define an additional footer |