Use editable
prop to let the user type a time.
Timepicker
An input with a simple dropdown/modal for selecting a time, uses native timepicker for mobile
# Editable (non readonly)
# Range
You can limit the date range with min-time
and max-time
props.
Any slots are added to the footer of the timepicker.
# Inline
Timepicker can also be shown inline with the inline
prop, input is removed, set a v-model
to get the date.
# Granularity
Timepicker can be set with a minute or hour ganularity with incrementMinutes
or incrementHours
.
# API
Name | Description | Type | Values | Default |
---|---|---|---|---|
v-model | Binding value | Date | — | — |
hour-format | Hour format for input and display | String | 12 or 24 | undefined : default to browser locale. |
increment-hours | Step hours for select component | Number | — | 1 |
increment-minutes | Step minutes for select component | Number | — | 1 |
time-formatter | Function to format time (Date type) to a string for display in the input | Function | — | (time) => new Intl.DateTimeFormat(locale).format(time) |
time-parser | Function to parse string to a time (Date type) for set a time from the input to the component | Function | — | Tries to parse the time using the locale specific format. Fallback to HH:mm or HH:mm AM/PM |
min-time | Earliest time available for selection | Date | — | — |
max-time | Latest time available for selection | Date | — | — |
size | Vertical size of input and picker, optional | String | is-small , is-medium , is-large | — |
inline | Timepicker is shown inline, input is removed | Boolean | — | false |
editable | Enable input/typing. Note that you might have to set a custom time parser | Boolean | — | false |
loading | Add the loading state to the input | Boolean | — | false |
icon | Icon name to be added | String | — | — |
icon-pack | Icon pack to use | String | mdi , fa , fas , far , fad , fal | mdi |
unselectable-times | Array of unselectable times (Date object) | Array | — | - |
mobile-native | Enable native timepicker on mobile | Boolean | true | |
mobile-modal | Timepicker is shown into a modal on mobile | Boolean | true , false | true |
position | Optional, position of the timepicker relative to the input | String | is-top-right , is-top-left , is-bottom-left | Bottom right |
open-on-focus | Open timepicker on input focus | Boolean | — | false |
enable-seconds | Show seconds picker | Boolean | - | false |
default-minutes | Default value when hours change | Number | - | - |
default-seconds | Default value when hours or minutes change | Number | - | - |
time-creator | Function used internally to create a new Date instance | Function | — | () => new Date() |
focusable | Timepicker container can be focused | Boolean | — | true |
append-to-body | Append timepicker calendar to body (prevents event bubbling) | Boolean | — | false |
locale | Accept a string with a BCP 47 language tag, or an array of such strings. See Unicode BCP 47 locale identifier | String, Array of String | — | undefined : default to browser locale. |
reset-on-meridian-change | Reset timepicker values on meridian change | Boolean | — | false |
Any native attribute | — | — | — | — |
This page is open source. Noticed a typo or something's unclear?