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 |
datepicker | Define props for the underlying datepicker component | DatepickerProps | - | |
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: { |
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. | boolean|string|object | - | From config: datetimepicker: { |
timepicker | Define props for the underlying timepicker component | TimepickerProps | - | |
useHtml5Validation | Enable html 5 native validation | boolean | - | From config: { |
v-model | date | - | ||
validationMessage | The message which is shown when a validation error occurs | string | - |
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 |