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

# Gregorian, Jalali & Hijri - React Calendar demo

Use the React calendar date picker with Gregorian, Jalali (Persian), and Hijri (Arabic) calendar system support for regional date selection. For React and Next.js.

- [Live demo](https://demo.mobiscroll.com/react/calendar/gregorian-jalali-hijri)
- [View React JS code on GitHub](https://github.com/acidb/mobiscroll-demos-react/tree/main/src/demos/datepicker/calendar/gregorian-jalali-hijri)
- [View React TS code on GitHub](https://github.com/acidb/mobiscroll-demos-react-ts/tree/main/src/demos/datepicker/calendar/gregorian-jalali-hijri)
- This demo in other frameworks: [JavaScript](https://demo.mobiscroll.com/calendar/gregorian-jalali-hijri.md), [jQuery](https://demo.mobiscroll.com/jquery/calendar/gregorian-jalali-hijri.md), [Angular](https://demo.mobiscroll.com/angular/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/react/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/react/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

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

With "Jalali":

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

With "Hijri":

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

## API used in this demo

- [`theme`](https://mobiscroll.com/docs/react/datepicker/api#opt-theme) - option
- [`themeVariant`](https://mobiscroll.com/docs/react/datepicker/api#opt-themeVariant) - option
- [`display`](https://mobiscroll.com/docs/react/datepicker/api#opt-display) - option
- [`calendarSystem`](https://mobiscroll.com/docs/react/datepicker/api#localization-calendarSystem) - option
- [`locale`](https://mobiscroll.com/docs/react/datepicker/api#localization-locale) - option
- [`controls`](https://mobiscroll.com/docs/react/datepicker/api#opt-controls) - option

## Code

### JSX

```jsx
import { Datepicker, hijriCalendar, jalaliCalendar, localeAr, localeFa, setOptions } from '@mobiscroll/react';

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

function App() {
  return (
    <div>
      <Datepicker display="inline" />
      <Datepicker display="inline" calendarSystem={jalaliCalendar} locale={localeFa} />
      <Datepicker display="inline" calendarSystem={hijriCalendar} locale={localeAr} />
    </div>
  );
}

export default App;
```

### TSX

```tsx
import { Datepicker, hijriCalendar, jalaliCalendar, localeAr, localeFa, setOptions } from '@mobiscroll/react';
import { FC } from 'react';

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

const App: FC = () => (
  <div>
    <Datepicker controls={['calendar']} display="inline" />
    <Datepicker controls={['calendar']} display="inline" calendarSystem={jalaliCalendar} locale={localeFa} />
    <Datepicker controls={['calendar']} display="inline" calendarSystem={hijriCalendar} locale={localeAr} />
  </div>
);
export default App;
```

## 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-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: [Event Hooks](https://demo.mobiscroll.com/react/calendar/event-hooks.md) - See which lifecycle events fire as users interact with the React date picker — in a live event log section, showing callback timing.
- Next: [Localization](https://demo.mobiscroll.com/react/calendar/localization.md) - Localize a React date picker across 37 languages — configure regional date/time formats, RTL layout, and button labels, with manual overrides.
