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
$('#time-picker').mobiscroll().datepicker({
controls: ['time '],
touchUi:
});
$('#time-24h-picker').mobiscroll().datepicker({
controls: ['time '],
timeFormat: 'HH:mm',
touchUi:
});
$('#time-12h-picker').mobiscroll().datepicker({
controls: ['time '],
timeFormat: 'h:mm A',
touchUi:
});
$('#hour-min-sec-picker').mobiscroll().datepicker({
controls: ['time '],
timeFormat: 'HH:mm:ss',
headerText: 'Time: {value}'
touchUi:
});
mobiscroll.setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
$(function () {
$('#demo-time')
.mobiscroll()
.datepicker({
controls: ['time'],
});
$('#demo-12h')
.mobiscroll()
.datepicker({
controls: ['time'],
timeFormat: 'HH:mm',
});
$('#demo-24h')
.mobiscroll()
.datepicker({
controls: ['time'],
timeFormat: 'h:mm A',
});
$('#demo-hms')
.mobiscroll()
.datepicker({
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>