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

# Gregorian, Jalali & Hijri - Angular Calendar demo

Use a Angular calendar date picker with Gregorian, Jalali (Persian), and Hijri (Arabic) calendar system support for regional date selection. For Angular 22 and Ionic 8.

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

## Description

The date picker supports multiple calendar systems. You can control it with the [`calendarSystem`](https://mobiscroll.com/docs/angular/datepicker/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/calendar/localization)

## What this demo shows

- Shows date picker examples for selecting a single date.
- **Calendar system picker** The left side of the calendar 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 in the top left opens a month and year picker. The blue previous and next arrow buttons on the right navigate between months.
- **Month view** A fixed weekday header displays abbreviated day names from Sunday through Saturday, with the dates arranged in a grid below it.
- **Month navigation** The month can be changed by clicking and dragging the calendar left or right.
- **Day cell states** Hovering a day highlights the day number with a gray background. Selecting a day highlights the day number with a blue background. The current date is highlighted by default and remains blue when the user selects another date.
- **Adjacent months** Dates from the previous and next months appear with a muted style. Selecting one navigates the calendar to the corresponding month.

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

## Tutorial

### Pick a calendar system

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

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

With "Jalali":

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

With "Hijri":

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

```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/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
- [`locale`](https://mobiscroll.com/docs/angular/datepicker/api#localization-locale) - option
- [`display`](https://mobiscroll.com/docs/angular/datepicker/api#opt-display) - option
- [`calendarSystem`](https://mobiscroll.com/docs/angular/datepicker/api#localization-calendarSystem) - option

## Code

### Component

```ts
import { CommonModule } from '@angular/common';
import { Component } from '@angular/core';
import { hijriCalendar, jalaliCalendar, localeAr, localeEn, localeFa, 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 {
  localeEn = localeEn;
  jalaliCalendar = jalaliCalendar;
  localeFa = localeFa;
  hijriCalendar = hijriCalendar;
  localeAr = localeAr;
}
```

### Template

```html
<mbsc-datepicker [controls]="['calendar']" [locale]="localeEn" display="inline" placeholder="Please Select..."></mbsc-datepicker>
<mbsc-datepicker
  [controls]="['calendar']"
  [calendarSystem]="jalaliCalendar"
  [locale]="localeFa"
  display="inline"
  placeholder="Please Select..."
></mbsc-datepicker>
<mbsc-datepicker
  [controls]="['calendar']"
  [calendarSystem]="hijriCalendar"
  [locale]="localeAr"
  display="inline"
  placeholder="Please Select..."
></mbsc-datepicker>
```

## Implementation notes

- Use `controls: ['calendar']` and `display: 'inline'`. `calendarSystem` and `locale` can be updated together at runtime via `setOptions({ calendarSystem, locale })` to switch which calendar system is active on a single picker instance.
- The picker initializes with no `calendarSystem`/`locale` set, defaulting to Gregorian/English. Selecting `Jalali` sets `calendarSystem: jalaliCalendar` with `locale: localeFa`; selecting `Hijri` sets `calendarSystem: hijriCalendar` with `locale: localeAr`; selecting `Gregorian` again explicitly sets `calendarSystem: gregorianCalendar` with `locale: localeEn` - `gregorianCalendar` and `localeEn` are real exports/namespace members used to switch back, not options the API lacks.
- React/Angular/Vue import `gregorianCalendar`, `jalaliCalendar`, `hijriCalendar`, `localeEn`, `localeFa`, `localeAr` as named exports from `@mobiscroll/react`/`@mobiscroll/angular`/`@mobiscroll/vue`; JS/jQuery reference them off the `mobiscroll` namespace (`mobiscroll.gregorianCalendar`, `mobiscroll.jalaliCalendar`, `mobiscroll.hijriCalendar`, `mobiscroll.locale.en`, `mobiscroll.locale.fa`, `mobiscroll.locale.ar`).
- The `locale` supplies month/day names and RTL layout direction alongside the calendar system's date rules for the non-Gregorian systems.

## 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: [Event Hooks](https://demo.mobiscroll.com/angular/calendar/event-hooks.md) - Explore Angular date picker lifecycle hooks — see which events fire on change, set, and init, and use the live event log to understand callback timing.
- Next: [Localization](https://demo.mobiscroll.com/angular/calendar/localization.md) - Localize a Angular date picker across 37 languages — configure regional date/time formats, RTL layout, and button labels, with manual overrides.
