Time selection
The date picker ships with five built-in variations for rendering the UI. The controls option supports the following:
date- renders a date-only scroller or dropdown controltime- renders a time-only scroller or dropdown controltimegrid- renders a time grid for time selectiondatetime- renders a date & time scroller or dropdowncalendar- renders a calendar view for date picking
When passing controls: ['time'], it will render a time-only picker - scroller for touchUi: true and a dropdown for touchUi: false. For a time grid use controls: ['timegrid'] instead.
You can change the timeFormat or rely on the formats coming from the locale settings.
Demo
<MbscDatepicker
:controls="['time ']"
:touchUi=" "
/>
<MbscDatepicker
:controls="['time ']"
:touchUi=" "
timeFormat="HH:mm"
/>
<MbscDatepicker
:controls="['time ']"
:touchUi=" "
timeFormat="h:mm A"
/>
<MbscDatepicker
:controls="['time ']"
:touchUi=" "
timeFormat="HH:mm:ss"
headerText="Time: {value}"
/>
<script setup>
import { MbscDatepicker, MbscPage, setOptions } from '@mobiscroll/vue'
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
})
</script>
<template>
<MbscPage>
<MbscDatepicker
:controls="['time']"
label="Time picker"
inputStyle="outline"
labelStyle="stacked"
placeholder="Please Select..."
/>
<MbscDatepicker
:controls="['time']"
timeFormat="HH:mm"
label="24 hour picker"
inputStyle="outline"
labelStyle="stacked"
placeholder="Please Select..."
/>
<MbscDatepicker
:controls="['time']"
timeFormat="h:mm A"
label="12 hour picker with AM/PM"
inputStyle="outline"
labelStyle="stacked"
placeholder="Please Select..."
/>
<MbscDatepicker
:controls="['time']"
timeFormat="HH:mm:ss"
headerText="Time: {value}"
label="Hour, Min, Sec"
inputStyle="outline"
labelStyle="stacked"
placeholder="Please Select..."
/>
</MbscPage>
</template>
<script setup lang="ts">
import { MbscDatepicker, MbscPage, setOptions } from '@mobiscroll/vue'
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
})
</script>
<template>
<MbscPage>
<MbscDatepicker
:controls="['time']"
label="Time picker"
inputStyle="outline"
labelStyle="stacked"
placeholder="Please Select..."
/>
<MbscDatepicker
:controls="['time']"
timeFormat="HH:mm"
label="24 hour picker"
inputStyle="outline"
labelStyle="stacked"
placeholder="Please Select..."
/>
<MbscDatepicker
:controls="['time']"
timeFormat="h:mm A"
label="12 hour picker with AM/PM"
inputStyle="outline"
labelStyle="stacked"
placeholder="Please Select..."
/>
<MbscDatepicker
:controls="['time']"
timeFormat="HH:mm:ss"
headerText="Time: {value}"
label="Hour, Min, Sec"
inputStyle="outline"
labelStyle="stacked"
placeholder="Please Select..."
/>
</MbscPage>
</template>