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.
<mbsc-datepicker
[controls]="['time']"
select="range"
display="inline"
[ touchUi] =" ">
</mbsc-datepicker>
For a time grid rendering pass 'timegrid' to the controls option.
<mbsc-datepicker
[controls]="['timegrid']"
select="range"
[ touchUi] =" ">
</mbsc-datepicker>
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.
<mbsc-datepicker
[controls]="['time']"
select="range"
[ touchUi] =" ">
</mbsc-datepicker>
Sometimes it makes sense to use two separate inputs for start and end. You can pass a reference through the startInput and endInput options of mobiscroll or any type of input, like an ion-input.
<mbsc-datepicker
[controls]="['time']"
select="range"
[startInput]="start"
[endInput]="end"
[ touchUi] =" ">
</mbsc-datepicker>
<mbsc-input
#start
placeholder="Please Select...">Start
</mbsc-input>
<mbsc-input
#end
placeholder="Please Select...">End
</mbsc-input>
import { CommonModule } from '@angular/common';
import { Component } from '@angular/core';
import { MbscModule, setOptions } from '@mobiscroll/angular';
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
standalone: true,
imports: [CommonModule, MbscModule],
})
export class AppComponent {}
<mbsc-page>
<mbsc-datepicker [controls]="['time']" select="range" display="inline"></mbsc-datepicker>
<mbsc-datepicker
[controls]="['time']"
select="range"
label="Range"
inputStyle="outline"
labelStyle="stacked"
placeholder="Please Select..."
></mbsc-datepicker>
<mbsc-datepicker [controls]="['time']" [startInput]="start" [endInput]="end" select="range"></mbsc-datepicker>
<div class="mbsc-grid mbsc-no-padding">
<div class="mbsc-row">
<div class="mbsc-col-6">
<mbsc-input #start placeholder="Please Select..." label="Start" inputStyle="outline" labelStyle="stacked">Start</mbsc-input>
</div>
<div class="mbsc-col-6">
<mbsc-input #end placeholder="Please Select..." label="End" inputStyle="outline" labelStyle="stacked">End</mbsc-input>
</div>
</div>
</div>
</mbsc-page>