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
mobiscroll.datepicker('#time-picker', {
controls: ['time '],
touchUi:
});
mobiscroll.datepicker('#time-24h-picker', {
controls: ['time '],
timeFormat: 'HH:mm',
touchUi:
});
mobiscroll.datepicker('#time-12h-picker', {
controls: ['time '],
timeFormat: 'h:mm A',
touchUi:
});
mobiscroll.datepicker('#hour-min-sec-picker', {
controls: ['time '],
timeFormat: 'HH:mm:ss',
headerText: 'Time: {value}'
touchUi:
});
mobiscroll.setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
mobiscroll.datepicker('#demo-time', {
controls: ['time'],
});
mobiscroll.datepicker('#demo-24h', {
controls: ['time'],
timeFormat: 'HH:mm',
});
mobiscroll.datepicker('#demo-12h', {
controls: ['time'],
timeFormat: 'h:mm A',
});
mobiscroll.datepicker('#demo-hms', {
controls: ['time'],
timeFormat: 'HH:mm:ss',
headerText: 'Time: {value}',
});
<label>
Time picker
<input id="demo-time" mbsc-input data-input-style="outline" data-label-style="stacked" placeholder="Please select..." />
</label>
<label>
24 hour picker
<input id="demo-24h" mbsc-input data-input-style="outline" data-label-style="stacked" placeholder="Please select..." />
</label>
<label>
12 h picker with AM/PM
<input id="demo-12h" mbsc-input data-input-style="outline" data-label-style="stacked" placeholder="Please select..." />
</label>
<label>
Hour, Min, Sec
<input id="demo-hms" mbsc-input data-input-style="outline" data-label-style="stacked" placeholder="Please select..." />
</label>