---
title: "Angular Timeline Gregorian, Jalali & Hijri Example | Mobiscroll"
component: "Timeline"
framework: "Angular"
library_version: "6.1.5"
url: "https://demo.mobiscroll.com/angular/timeline/gregorian-jalali-hijri"
---

# Gregorian, Jalali & Hijri - Angular Timeline demo

Use the Angular Timeline with Gregorian, Jalali, or Hijri calendar systems — switch by locale to build scheduling interfaces for Persian. For Angular 22 and Ionic 8.

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

## Description

The timeline supports multiple calendar systems. You can control it with the [`calendarSystem`](https://mobiscroll.com/docs/angular/eventcalendar/api#localization-calendarSystem) setting, and it supports the following options:

- **Gregorian** - it is included by default
- **Jalali** - it is the default system of the Persian calendar and is included within the Farsi language pack
- **Hijri** - it is included in the Arabic language pack

**Interested in localization?** [Explore this example →](https://demo.mobiscroll.com/angular/timeline/localization)

## What this demo shows

- A desktop daily timeline where hours are arranged horizontally and a hierarchical resource tree arranged vertically on the left.
- **Calendar system picker** The left side of the timeline shows a `Pick a calendar system` label with three options, where Gregorian is selected by default and choosing another option (Jalali or Hijri) updates the calendar system.
- **Header navigation** The month and year label opens date navigation, while the previous and next arrows move between days and the Today button returns to the current date.
- **Day view** The strip below the header shows the selected days, with the current date highlighted. The timeline displays hourly columns from 12 AM to 12 PM.
- **Resources** Multiple resources are shown as separate timeline rows.
- **Current time** A vertical blue line with a time label marks the current time.
- **Hover behavior** Hovering over the time grid shows a time indicator that follows the cursor in 15-minute increments.
- **Event cards** Events are shown as colored cards with a left color stripe, a bold title, a description, and a bold time range.
- **Date positioning** Events are positioned by their assigned resource and exact date range.
- **Event interaction** Events highlight on hover and show drag and resize handles for repositioning or changing duration.
- **Event selection** Clicking an event selects and highlights it.
- **Event creation** New events can be created by double-clicking the timeline or by clicking and dragging across a time range.
- **Scrolling** The timeline supports horizontal and vertical scrolling for navigating through time and resources.

## Best for

- **Regional user experiences** Products that need to present dates in the calendar system users already rely on, such as Gregorian for international audiences, Jalali for Persian-speaking users, or Hijri for Arabic-speaking users.
- **Localized scheduling flows** Booking, planning, and event management interfaces where users need to browse months, review events, and select dates in a familiar calendar system.

## Tutorial

### Pick a calendar system

- (x) Gregorian
- ( ) Jalali
- ( ) Hijri

```html
<mbsc-eventcalendar
    [locale]="localeEn">
</mbsc-eventcalendar>
```

With "Jalali":

```html
<mbsc-eventcalendar
    [calendarSystem]="jalaliCalendar"
    [locale]="localeFa">
</mbsc-eventcalendar>
```

With "Hijri":

```html
<mbsc-eventcalendar
    [calendarSystem]="hijriCalendar"
    [locale]="localeAr">
</mbsc-eventcalendar>
```

```ts
import { localeEn } from '@mobiscroll/angular';

class myComponent {
    public localeEn = localeEn;
}
```

With "Jalali":

```ts
import { jalaliCalendar, localeFa } from '@mobiscroll/angular';

class myComponent {
    public jalaliCalendar = jalaliCalendar;
    public localeFa = localeFa;
}
```

With "Hijri":

```ts
import { hijriCalendar, localeAr } from '@mobiscroll/angular';

class myComponent {
    public hijriCalendar = hijriCalendar;
    public localeAr = localeAr;
}
```

## API used in this demo

- [`theme`](https://mobiscroll.com/docs/angular/eventcalendar/api#opt-theme) - option
- [`themeVariant`](https://mobiscroll.com/docs/angular/eventcalendar/api#opt-themeVariant) - option
- [`locale`](https://mobiscroll.com/docs/angular/eventcalendar/api#localization-locale) - option
- [`view`](https://mobiscroll.com/docs/angular/eventcalendar/api#opt-view) - option
- [`calendarSystem`](https://mobiscroll.com/docs/angular/eventcalendar/api#localization-calendarSystem) - option
- [`data`](https://mobiscroll.com/docs/angular/eventcalendar/api#opt-data) - option
- [`resources`](https://mobiscroll.com/docs/angular/eventcalendar/api#opt-resources) - option

## Code

### Component

```ts
import { CommonModule } from '@angular/common';
import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import {
  hijriCalendar,
  jalaliCalendar,
  localeAr,
  localeEn,
  localeFa,
  MbscCalendarEvent,
  MbscEventcalendarOptions,
  MbscModule,
  MbscResource,
  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 implements OnInit {
  constructor(private http: HttpClient) {}

  myEvents: MbscCalendarEvent[] = [];
  myResources: MbscResource[] = [
    {
      id: 1,
      name: 'Ryan',
      color: '#fdf500',
    },
    {
      id: 2,
      name: 'Kate',
      color: '#ff4600',
    },
    {
      id: 3,
      name: 'John',
      color: '#ff0101',
    },
    {
      id: 4,
      name: 'Mark',
      color: '#239a21',
    },
    {
      id: 5,
      name: 'Sharon',
      color: '#8f1ed6',
    },
    {
      id: 6,
      name: 'Ashley',
      color: '#01adff',
    },
  ];

  gregorianOptions: MbscEventcalendarOptions = {
    locale: localeEn,
    view: {
      timeline: { type: 'day' },
    },
  };

  jalaliOptions: MbscEventcalendarOptions = {
    calendarSystem: jalaliCalendar,
    locale: localeFa,
    view: {
      timeline: { type: 'day' },
    },
  };

  hijriOptions: MbscEventcalendarOptions = {
    calendarSystem: hijriCalendar,
    locale: localeAr,
    view: {
      timeline: { type: 'day' },
    },
  };

  ngOnInit(): void {
    this.http.jsonp<MbscCalendarEvent[]>('https://trial.mobiscroll.com/timeline-events/', 'callback').subscribe((resp) => {
      this.myEvents = resp;
    });
  }
}
```

### Template

```html
<mbsc-page>
  <div class="mbsc-grid">
    <div class="mbsc-row">
      <div class="mbsc-col-sm-12 mbsc-col-md-4">
        <div class="mbsc-form-group">
          <div class="mbsc-form-group-title">Gregorian calendar</div>
          <mbsc-eventcalendar [data]="myEvents" [resources]="myResources" [options]="gregorianOptions"></mbsc-eventcalendar>
        </div>
      </div>
      <div class="mbsc-col-sm-12 mbsc-col-md-4">
        <div class="mbsc-form-group">
          <div class="mbsc-form-group-title">Jalali calendar</div>
          <mbsc-eventcalendar [data]="myEvents" [resources]="myResources" [options]="jalaliOptions"></mbsc-eventcalendar>
        </div>
      </div>
      <div class="mbsc-col-sm-12 mbsc-col-md-4">
        <div class="mbsc-form-group">
          <div class="mbsc-form-group-title">Hijri calendar</div>
          <mbsc-eventcalendar [data]="myEvents" [resources]="myResources" [options]="hijriOptions"></mbsc-eventcalendar>
        </div>
      </div>
    </div>
  </div>
</mbsc-page>
```

## Implementation notes

- Render three separate `Eventcalendar` instances on one page, each using `timeline: { type: 'day' }` and the same 6 resources (`id`, `name`, `color`).
- Load events once from `https://trial.mobiscroll.com/timeline-events/` via JSONP using `getJson(url, callback, 'jsonp')`. In the callback, share the same events array across all three instances: React/Angular/Vue assign it to the reactive state/property bound to each instance's `data` prop; for the imperative API (JS/jQuery), call `inst.setEvents(events)` on each of the three instances.
- **Gregorian instance** - no `calendarSystem` needed (Gregorian is the default). Pass `locale: localeEn` (or omit for the default).
- **Jalali instance** - pass `calendarSystem: jalaliCalendar` and `locale: localeFa`. `jalaliCalendar` and `localeFa` are imported from the Mobiscroll package.
- **Hijri instance** - pass `calendarSystem: hijriCalendar` and `locale: localeAr`. `hijriCalendar` and `localeAr` are imported from the Mobiscroll package.
- Wrap the page in a Mobiscroll `Page` component. Use a Mobiscroll grid (`mbsc-grid` / `mbsc-row`) with three equal columns (`mbsc-col-sm-12 mbsc-col-md-4`). Each column contains a `mbsc-form-group` with a `mbsc-form-group-title` label ("Gregorian calendar", "Jalali calendar", "Hijri calendar") above its `Eventcalendar` instance.

## 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

- Next: [Event Hooks](https://demo.mobiscroll.com/angular/timeline/event-hooks.md) - Explore Angular Timeline lifecycle hooks — see hooks fire on event clicks, initialization, and date changes, tracked in a live event log.
