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

# Gregorian, Jalali & Hijri - React Event calendar demo

Show events in Gregorian, Jalali, or Hijri with the React event calendar — switch between calendar systems to support Persian. For React and Next.JS.

- [Live demo](https://demo.mobiscroll.com/react/eventcalendar/gregorian-jalali-hijri)
- [View React JS code on GitHub](https://github.com/acidb/mobiscroll-demos-react/tree/main/src/demos/eventcalendar/calendar-view/gregorian-jalali-hijri)
- [View React TS code on GitHub](https://github.com/acidb/mobiscroll-demos-react-ts/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), [Angular](https://demo.mobiscroll.com/angular/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/react/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/react/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

```jsx
<Eventcalendar
                            locale={localeEn}
/>
```

With "Jalali":

```jsx
<Eventcalendar
                            calendarSystem={jalaliCalendar}
                            locale={localeFa}
/>
```

With "Hijri":

```jsx
<Eventcalendar
                            calendarSystem={hijriCalendar}
                            locale={localeAr}
/>
```

## API used in this demo

- [`theme`](https://mobiscroll.com/docs/react/eventcalendar/api#opt-theme) - option
- [`themeVariant`](https://mobiscroll.com/docs/react/eventcalendar/api#opt-themeVariant) - option
- [`labels`](https://mobiscroll.com/docs/react/eventcalendar/api#opt-labels) - option
- [`clickToCreate`](https://mobiscroll.com/docs/react/eventcalendar/api#opt-clickToCreate) - option
- [`dragToCreate`](https://mobiscroll.com/docs/react/eventcalendar/api#opt-dragToCreate) - option
- [`dragToMove`](https://mobiscroll.com/docs/react/eventcalendar/api#opt-dragToMove) - option
- [`dragToResize`](https://mobiscroll.com/docs/react/eventcalendar/api#opt-dragToResize) - option
- [`eventDelete`](https://mobiscroll.com/docs/react/eventcalendar/api#opt-eventDelete) - option
- [`data`](https://mobiscroll.com/docs/react/eventcalendar/api#opt-data) - option
- [`view`](https://mobiscroll.com/docs/react/eventcalendar/api#opt-view) - option
- [`calendarSystem`](https://mobiscroll.com/docs/react/eventcalendar/api#localization-calendarSystem) - option
- [`locale`](https://mobiscroll.com/docs/react/eventcalendar/api#localization-locale) - option

## Code

### JSX

```jsx
import { Eventcalendar, getJson, hijriCalendar, jalaliCalendar, localeAr, localeFa, Page, setOptions } from '@mobiscroll/react';
import { useEffect, useMemo, useState } from 'react';

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

function App() {
  const [myEvents, setEvents] = useState([]);

  const myView = useMemo(() => ({ calendar: { labels: true } }), []);

  useEffect(() => {
    getJson(
      'https://trial.mobiscroll.com/events/?vers=5',
      (events) => {
        setEvents(events);
      },
      'jsonp',
    );
  }, []);

  return (
    <Page>
      <div className="mbsc-grid">
        <div className="mbsc-row">
          <div className="mbsc-col-sm-12 mbsc-col-md-4">
            <div className="mbsc-form-group">
              <div className="mbsc-form-group-title">Gregorian calendar</div>
              <Eventcalendar
                clickToCreate={true}
                dragToCreate={true}
                dragToMove={true}
                dragToResize={true}
                eventDelete={true}
                data={myEvents}
                view={myView}
              />
            </div>
          </div>
          <div className="mbsc-col-sm-12 mbsc-col-md-4">
            <div className="mbsc-form-group">
              <div className="mbsc-form-group-title">Jalali calendar</div>
              <Eventcalendar
                clickToCreate={true}
                dragToCreate={true}
                dragToMove={true}
                dragToResize={true}
                eventDelete={true}
                data={myEvents}
                calendarSystem={jalaliCalendar}
                locale={localeFa}
                view={myView}
              />
            </div>
          </div>
          <div className="mbsc-col-sm-12 mbsc-col-md-4">
            <div className="mbsc-form-group">
              <div className="mbsc-form-group-title">Hijri calendar</div>
              <Eventcalendar
                clickToCreate={true}
                dragToCreate={true}
                dragToMove={true}
                dragToResize={true}
                eventDelete={true}
                data={myEvents}
                calendarSystem={hijriCalendar}
                locale={localeAr}
                view={myView}
              />
            </div>
          </div>
        </div>
      </div>
    </Page>
  );
}

export default App;
```

### TSX

```tsx
import {
  Eventcalendar,
  getJson,
  hijriCalendar,
  jalaliCalendar,
  localeAr,
  localeFa,
  MbscCalendarEvent,
  MbscEventcalendarView,
  Page,
  setOptions,
} from '@mobiscroll/react';
import { FC, useEffect, useMemo, useState } from 'react';

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

const App: FC = () => {
  const [myEvents, setEvents] = useState<MbscCalendarEvent[]>([]);

  const myView = useMemo<MbscEventcalendarView>(
    () => ({
      calendar: { labels: true },
    }),
    [],
  );

  useEffect(() => {
    getJson(
      'https://trial.mobiscroll.com/events/?vers=5',
      (events: MbscCalendarEvent[]) => {
        setEvents(events);
      },
      'jsonp',
    );
  }, []);

  return (
    <Page>
      <div className="mbsc-grid">
        <div className="mbsc-row">
          <div className="mbsc-col-sm-12 mbsc-col-md-4">
            <div className="mbsc-form-group">
              <div className="mbsc-form-group-title">Gregorian calendar</div>
              <Eventcalendar
                clickToCreate={true}
                dragToCreate={true}
                dragToMove={true}
                dragToResize={true}
                eventDelete={true}
                data={myEvents}
                view={myView}
              />
            </div>
          </div>
          <div className="mbsc-col-sm-12 mbsc-col-md-4">
            <div className="mbsc-form-group">
              <div className="mbsc-form-group-title">Jalali calendar</div>
              <Eventcalendar
                clickToCreate={true}
                dragToCreate={true}
                dragToMove={true}
                dragToResize={true}
                eventDelete={true}
                data={myEvents}
                calendarSystem={jalaliCalendar}
                locale={localeFa}
                view={myView}
              />
            </div>
          </div>
          <div className="mbsc-col-sm-12 mbsc-col-md-4">
            <div className="mbsc-form-group">
              <div className="mbsc-form-group-title">Hijri calendar</div>
              <Eventcalendar
                clickToCreate={true}
                dragToCreate={true}
                dragToMove={true}
                dragToResize={true}
                eventDelete={true}
                data={myEvents}
                calendarSystem={hijriCalendar}
                locale={localeAr}
                view={myView}
              />
            </div>
          </div>
        </div>
      </div>
    </Page>
  );
};
export default App;
```

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

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

   ```
   npm install
   ```

6. Run the project:

   ```
   npm run dev
   ```

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

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

## Related demos

- Previous: [Localization](https://demo.mobiscroll.com/react/eventcalendar/localization.md) - Localize a React 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/react/eventcalendar/event-hooks.md) - See which lifecycle hooks the React event calendar fires on create, drag, hover, and click — interactions are tracked in a live event log.
