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 |
creator | Date creator function, default is new Date() | (() => Date) | - | From config: datetimepicker: { |
customValidity | Custom HTML 5 validation error to set on the form control | string | ((currentValue: Date | null, state: ValidityState) => string) | undefined | - | "" |
datepicker | Define props for the underlying datepicker component | DatepickerProps | - | |
disabled | Same as native disabled | boolean | - | false |
expanded | Makes input full width when inside a grouped or addon field | boolean | - | false |
formatter | Custom function to format a date into a string | ((date: Date) => string) | undefined | - | From config: datetimepicker: { |
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 | - | |
openOnFocus | Open dropdown on focus | boolean | - | From config: datetimepicker: { |
override | Override existing theme classes completely | boolean | - | |
parser | Custom function to parse a string into a date | ((date: string) => Date) | undefined | - | From config: datetimepicker: { |
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 | object | - | From config: datetimepicker: { |
timepicker | Define props for the underlying timepicker component | TimepickerProps | - | |
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 - 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 |