---
title: "Angular Range Time Range Picker Example | Mobiscroll"
component: "Range"
framework: "Angular"
library_version: "6.1.5"
url: "https://demo.mobiscroll.com/angular/range/time-range"
---

# Time Range Picker - Angular Range demo

Select start and end times with the Angular time range picker — inline scroller, time grid, or single/split input layouts for any form design. For Angular 22 and Ionic 8.

- [Live demo](https://demo.mobiscroll.com/angular/range/time-range)
- [View code on GitHub](https://github.com/acidb/mobiscroll-demos-angular/tree/main/src/demos/datepicker/range/time-range)
- This demo in other frameworks: [JavaScript](https://demo.mobiscroll.com/javascript/range/time-range.md), [jQuery](https://demo.mobiscroll.com/jquery/range/time-range.md), [React](https://demo.mobiscroll.com/react/range/time-range.md), [Vue](https://demo.mobiscroll.com/vue/range/time-range.md)

## Description

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 selection
- `timegrid` - will render a time grid for range selection
- `calendar` - will render a calendar view for date range selection ([explore date ranges](https://demo.mobiscroll.com/angular/range/date-range))
- `date` - will render a date scroller or dropdown for date range selection ([explore date ranges](https://demo.mobiscroll.com/angular/range/date-range))
- `datetime` - will render a compact date scroller or dropdown with time picker for date & time range selection ([explore date & time ranges](https://demo.mobiscroll.com/angular/range/date-time-range))

## What this demo shows

- Four inline examples of time-only range selection, each using a different control configuration.
- **Inline time scroller** A compact scroller for picking start and end times directly on the page, without any date component.
- **Inline time grid** A time grid displayed at 30-minute increments, letting users select a start and end slot by tapping directly on the grid.
- **Single input with popover** One input field that opens a time range scroller as a popover on mobile and as a dropdown on desktop.
- **Separate start and end inputs** Dedicated input fields for start and end time, each opening its own popover/dropdown scroller. In all examples the selected start and end times are displayed above the picker component.

## Best for

- **Time-only scheduling** Use cases where only the time range matters and no date needs to be selected, such as setting working hours, defining shift windows, or configuring opening times.
- **Slot-based selection** The time grid variant is well-suited for appointment booking or resource scheduling where time is divided into fixed increments.
- **Flexible form layouts** The four examples cover the main form patterns (inline, single input, split inputs), making it straightforward to match the control to the surrounding form design.

## Tutorial

### Embeddable time range

Use the time range inline by setting the `display` option to `inline`. Learn about [the different ways to use the picker](https://demo.mobiscroll.com/angular/range/usage-on-input-or-inline).

```html
<mbsc-datepicker
    [controls]="['time']"
    select="range"
    display="inline"
    [touchUi]="true">
</mbsc-datepicker>
```

### Time range selection with a time grid

For a time grid rendering pass `'timegrid'` to the `controls` option.

```html
<mbsc-datepicker
    [controls]="['timegrid']"
    select="range"
    [touchUi]="true">
</mbsc-datepicker>
```

### Using the range with one input

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](https://demo.mobiscroll.com/angular/range/mobile-desktop-display).

```html
<mbsc-datepicker
    [controls]="['time']"
    select="range"
    [touchUi]="true">
</mbsc-datepicker>
```

### Using the range with two inputs

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`.

```html
<mbsc-datepicker
    [controls]="['time']"
    select="range"
    [startInput]="start"
    [endInput]="end"
    [touchUi]="true">
</mbsc-datepicker>

<mbsc-input
    #start
    placeholder="Please Select...">Start
</mbsc-input>

<mbsc-input
    #end
    placeholder="Please Select...">End
</mbsc-input>
```

## API used in this demo

- [`theme`](https://mobiscroll.com/docs/angular/datepicker/api#opt-theme) - option
- [`themeVariant`](https://mobiscroll.com/docs/angular/datepicker/api#opt-themeVariant) - option
- [`controls`](https://mobiscroll.com/docs/angular/datepicker/api#opt-controls) - option
- [`select`](https://mobiscroll.com/docs/angular/datepicker/api#opt-select) - option
- [`display`](https://mobiscroll.com/docs/angular/datepicker/api#opt-display) - option
- [`inputStyle`](https://mobiscroll.com/docs/angular/datepicker/api#opt-inputStyle) - option
- [`labelStyle`](https://mobiscroll.com/docs/angular/datepicker/api#opt-labelStyle) - option
- [`startInput`](https://mobiscroll.com/docs/angular/datepicker/api#opt-startInput) - option
- [`endInput`](https://mobiscroll.com/docs/angular/datepicker/api#opt-endInput) - option

## Code

### Component

```ts
import { CommonModule } from '@angular/common';
import { Component } from '@angular/core';
import { MbscModule, setOptions } from '@mobiscroll/angular';

setOptions({
  theme: 'ios',
  themeVariant: 'light'
});

@Component({
  selector: 'app-root', 
  templateUrl: './app.component.html',
  standalone: true,
  imports: [CommonModule, MbscModule],
})
export class AppComponent {}
```

### Template

```html
<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>
```

## Implementation notes

- Set `select: 'range'` together with `controls` to pick the time-range rendering: `['time']` renders a scroller/dropdown time picker, `['timegrid']` renders a tappable time grid (30-minute slots in this demo), `['date']`/`['calendar']` render date-only range pickers, and `['datetime']` renders a combined date & time range picker.
- Set `display: 'inline'` to embed the picker directly in the page instead of anchoring it to an input.
- For a single-input range, initialize the `Datepicker` on one input element (or bind `value`/`v-model`/`[(ngModel)]` in the component frameworks) - the same input shows both the selected start and end time.
- For two separate inputs, pass `startInput` and `endInput` pointing at the start/end fields: JS/jQuery take CSS selector strings (`startInput: '#start', endInput: '#end'`); React takes state/ref values (`startInput={start} endInput={end}`) set via input `ref` callbacks; Vue takes `ref()` values bound with `:startInput="startInput" :endInput="endInput"`; Angular takes template reference variables bound with `[startInput]="start" [endInput]="end"` where `start`/`end` are declared with `#start`/`#end` on the corresponding `mbsc-input` elements.
- `touchUi` controls whether the time picker renders as a touch-friendly scroller (`true`) or a compact dropdown (`false`); it can be set directly in the options/props or updated at runtime via `.setOptions({ touchUi })` (JS/jQuery) or by updating the bound prop.

## Run it in your project

1. If not signed up yet, or don't own a license, you can [start a free trial](https://mobiscroll.com/starttrial).

2. Clone the repository:

   ```
   git clone https://github.com/acidb/mobiscroll-demos-angular.git
   ```

3. If not installed yet, install the Mobiscroll CLI from NPM:

   ```
   npm install -g @mobiscroll/cli
   ```

4. Config Mobiscroll - open a terminal window in the root directory and run:

   ```
   mobiscroll config angular
   ```

5. Install dependencies - open a terminal window in the root directory and run:

   ```
   npm install
   ```

6. Run the project:

   ```
   ng serve
   ```

On a trial, add `--trial` to the config command: `mobiscroll config angular --trial`.

Running a demo locally requires a Mobiscroll trial or a license; setup is per framework at https://mobiscroll.com/docs/angular/getting-started/installation

## Related demos

- Previous: [Date Range Picker](https://demo.mobiscroll.com/angular/range/date-range.md) - Set up a Angular date range picker as a calendar view or date scroller — inline or in a popup, with one or two inputs.
- Next: [Date Time Range Picker](https://demo.mobiscroll.com/angular/range/date-time-range.md) - Pick start and end date-times with the Angular range picker — choose calendar, time grid, or date-time scroller with single or split inputs.
