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

# Gregorian, Jalali & Hijri - Angular Event calendar demo

Show events in Gregorian, Jalali, or Hijri with the Angular event calendar — switch between calendar systems to support Persian.

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

## Description

The event calendar 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/eventcalendar/localization)

## What this demo shows

- A desktop month-view event calendar with a segmented control for switching between Gregorian, Jalali, and Hijri calendar systems.
- **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.
- **Calendar header** The header shows the current month and year on the left, and blue month navigation arrows with a `Today` button (for jumping back to the current date) between them on the right. 
- **Event labels** Day cells render events as labels with different colors and styles to distinguish all-day, multi-day, and timed events.
- **Overflow handling** The number of visible event labels depends on the available height in each day cell. Additional events are collapsed behind an `X more` link.
- **Popover** Clicking the `X more` link opens a popover that shows the hidden events for that day.
- **Label interaction** Hovering over or clicking an event label selects it and highlights the selected label.
- **Day cell states for future days** Hovering a day cell highlights the day number with a gray background, while clicking the empty part of the cell selects the day and highlights the day number with a blue background.
- **Month navigation** The month can be changed either with the header arrows or by clicking and dragging the calendar left or right.

## 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
- [`calendarSystem`](https://mobiscroll.com/docs/angular/eventcalendar/api#localization-calendarSystem) - option
- [`data`](https://mobiscroll.com/docs/angular/eventcalendar/api#opt-data) - 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,
  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[] = [];

  gregorianOptions: MbscEventcalendarOptions = {
    locale: localeEn,
  };

  jalaliOptions: MbscEventcalendarOptions = {
    calendarSystem: jalaliCalendar,
    locale: localeFa,
  };

  hijriOptions: MbscEventcalendarOptions = {
    calendarSystem: hijriCalendar,
    locale: localeAr,
  };

  ngOnInit(): void {
    this.http.jsonp<MbscCalendarEvent[]>('https://trial.mobiscroll.com/events/?vers=5', '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" [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" [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" [options]="hijriOptions"></mbsc-eventcalendar>
        </div>
      </div>
    </div>
  </div>
</mbsc-page>
```

## Implementation notes

- Render three separate `Eventcalendar` instances on one page in a responsive 3-column grid (`mbsc-col-sm-12 mbsc-col-md-4`), each inside an `mbsc-form-group` with an `mbsc-form-group-title`. Use `view: { calendar: { labels: true } }` for all three. Wrap the page in a `Page` component.
- **Gregorian instance** - no `calendarSystem` needed (Gregorian is the default). Angular and JS/jQuery also pass `locale: localeEn` explicitly; React and Vue omit it.
- **Jalali instance** - pass `calendarSystem: jalaliCalendar` and `locale: localeFa`, both imported from the Mobiscroll package. JS/jQuery: access as `mobiscroll.jalaliCalendar` and `mobiscroll.locale.fa`.
- **Hijri instance** - pass `calendarSystem: hijriCalendar` and `locale: localeAr`, both imported from the Mobiscroll package. JS/jQuery: access as `mobiscroll.hijriCalendar` and `mobiscroll.locale.ar`.
- Load events once from `https://trial.mobiscroll.com/events/?vers=5` via JSONP using `getJson(url, callback, 'jsonp')`. Angular: use `HttpClient.jsonp()` instead. For state-based frameworks, share one reactive events array bound to all three instances. For the imperative API (JS/jQuery), call `inst.setEvents(events)` on each of the three instances inside the callback.

## 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: [Localization](https://demo.mobiscroll.com/angular/eventcalendar/localization.md) - Localize a Angular event calendar — switch locales to update date and time formats, button labels, and RTL layout. All settings overridable.
- Next: [Event Hooks](https://demo.mobiscroll.com/angular/eventcalendar/event-hooks.md) - See which lifecycle hooks the Angular event calendar fires on create, drag, hover, and click — interactions are tracked in a live event log.
