Time Range Picker
Set up the range picker for time pair selection. Regardless if you are interested in the start/end date or the actual range, you have several possibilities of rendering a time range picker. The controls option supports different values:
time- will render a time picker or dropdown for range selectiontimegrid- will render a time grid for range selectioncalendar- will render a calendar view for date range selection (explore date ranges)date- will render a date scroller or dropdown for date range selection (explore date ranges)datetime- will render a compact date scroller or dropdown with time picker for date & time range selection (explore date & time ranges)
Demo
Use the time range inline by setting the display option to inline. Learn about the different ways to use the picker.
mobiscroll.datepicker('#picker', {
controls: ['time'],
select: 'range',
display: 'inline',
touchUi:
});
For a time grid rendering pass 'timegrid' to the controls option.
mobiscroll.datepicker('#picker', {
controls: ['timegrid'],
select: 'range',
touchUi:
});
Besides rendering it inline, you can link the range to an input that can be a Mobiscroll input or an existing field. Explore the different ways to display the picker.
mobiscroll.datepicker('#picker', {
controls: ['time'],
select: 'range',
touchUi:
});
When using two separate inputs for start and end, you will want to initialize the component on the first input and make sure to pass the references of the two inputs through the startInput and endInput options.
html<div id="range"></div>
<label>
Start
<input id="start" mbsc-input placeholder="Please select..." />
</label>
<label>
End
<input id="end" mbsc-input placeholder="Please select..." />
</label>
js$('#range').mobiscroll().datepicker({
controls: ['time'],
select: 'range',
startInput: '#start',
endInput: '#end',
touchUi:
});
mobiscroll.setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
$(function () {
$('#demo-time')
.mobiscroll()
.datepicker({
controls: ['time'],
select: 'range',
display: 'inline',
});
$('#demo-timegrid')
.mobiscroll()
.datepicker({
controls: ['timegrid'],
select: 'range',
display: 'inline',
});
$('#demo-one-input')
.mobiscroll()
.datepicker({
controls: ['time'],
select: 'range',
});
$('#demo-start-end')
.mobiscroll()
.datepicker({
controls: ['time'],
select: 'range',
startInput: '#demo-start',
endInput: '#demo-end',
});
});
<div id="demo-time"></div>
<div id="demo-timegrid"></div>
<label>
Range
<input id="demo-one-input" mbsc-input data-input-style="outline" data-label-style="stacked" placeholder="Please select..." />
</label>
<div id="demo-start-end"></div>
<div class="mbsc-grid mbsc-no-padding">
<div class="mbsc-row">
<div class="mbsc-col-6">
<label>
Start
<input id="demo-start" mbsc-input data-input-style="outline" data-label-style="stacked" placeholder="Please select..." />
</label>
</div>
<div class="mbsc-col-6">
<label>
End
<input id="demo-end" mbsc-input data-input-style="outline" data-label-style="stacked" placeholder="Please select..." />
</label>
</div>
</div>
</div>