npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mantine-datepicker-persian

v0.1.6

Published

Jalali (Persian) calendar and date pickers for Mantine

Readme

mantine-datepicker-persian

Jalali (Persian / Shamsi) date and time pickers for Mantine v9.

Drop-in replacement for @mantine/dates with Persian calendar support. Same API as @mantine/[email protected] — swap the import and set locale="fa".

npm i mantine-datepicker-persian @mantine/core @mantine/hooks dayjs

Package name on npm: mantine-datepicker-persian
Repo: samirarezai/mantine-datepicker-jalali


Why this package?

@mantine/dates only supports Gregorian calendars. This package forks it and adds Jalali rendering when the locale is fa / fa-IR:

| | @mantine/dates | mantine-datepicker-persian | | --- | --- | --- | | Gregorian | Yes | Yes | | Jalali (Persian) | No | Yes (locale="fa") | | Mantine version | 9.x | 9.x | | Value type | YYYY-MM-DD strings | Same |

Do not install both. Use this package instead of @mantine/dates.


Requirements

| Peer dependency | Version | | --- | --- | | @mantine/core | >=9 <10 | | @mantine/hooks | >=9 <10 | | dayjs | >=1.11 <2 | | react / react-dom | >=19 <20 |


Setup

1. Install

npm i mantine-datepicker-persian @mantine/core @mantine/hooks dayjs

2. Import CSS (once, in your app root)

import '@mantine/core/styles.css';
import 'mantine-datepicker-persian/styles.css';
import 'dayjs/locale/fa';

Optional CSS layer variant (if you use Mantine layers):

import 'mantine-datepicker-persian/styles.layer.css';

3. Wrap your app

import { DirectionProvider, MantineProvider } from '@mantine/core';
import { DatesProvider } from 'mantine-datepicker-persian';

export function App({ children }: { children: React.ReactNode }) {
  return (
    <DirectionProvider initialDirection="rtl">
      <MantineProvider>
        <DatesProvider
          settings={{
            locale: 'fa',
            firstDayOfWeek: 6, // Saturday
            weekendDays: [5], // Friday
          }}
        >
          {children}
        </DatesProvider>
      </MantineProvider>
    </DirectionProvider>
  );
}

| Setting | Persian calendar recommendation | | --- | --- | | locale | 'fa' | | firstDayOfWeek | 6 (Saturday) | | weekendDays | [5] (Friday) | | Direction | RTL via DirectionProvider |


Date values

Values are strings, not Date objects (same as Mantine Dates 8+):

| Component | Value shape | Example | | --- | --- | --- | | Date (default) | string \| null | '2024-03-20' | | Date + time | string \| null | '2024-03-20 14:30:00' | | Multiple | string[] | ['2024-03-20', '2024-03-21'] | | Range | [string \| null, string \| null] | ['2024-03-20', '2024-03-25'] |

The stored value is always Gregorian ISO (YYYY-MM-DD). The UI shows Jalali when locale="fa".


Components

DateInput — typeable input + calendar

import { useState } from 'react';
import { DateInput, DateValue } from 'mantine-datepicker-persian';

function Example() {
  const [value, setValue] = useState<DateValue>(null);

  return (
    <DateInput
      label="تاریخ"
      placeholder="تاریخ را وارد کنید"
      value={value}
      onChange={setValue}
      locale="fa"
      clearable
    />
  );
}

DatePickerInput — input that opens a calendar dropdown

import { DatePickerInput } from 'mantine-datepicker-persian';

<DatePickerInput
  label="تاریخ"
  value={value}
  onChange={setValue}
  locale="fa"
  clearable
/>

DateTimePicker — date + time

import { DateTimePicker } from 'mantine-datepicker-persian';

<DateTimePicker
  label="تاریخ و زمان"
  value={dateTime}
  onChange={setDateTime}
  locale="fa"
  clearable
  valueFormat="YYYY/MM/DD HH:mm"
/>

valueFormat tokens (YYYY, MM, DD, HH, mm, …) are rendered in Jalali when locale="fa".

DatePicker — inline calendar

Single

<DatePicker value={value} onChange={setValue} locale="fa" />

Multiple

const [dates, setDates] = useState<string[]>([]);

<DatePicker
  type="multiple"
  value={dates}
  onChange={setDates}
  locale="fa"
  firstDayOfWeek={6}
  weekendDays={[5]}
/>

Range

const [range, setRange] = useState<[string | null, string | null]>([null, null]);

<DatePicker
  type="range"
  value={range}
  onChange={setRange}
  locale="fa"
  firstDayOfWeek={6}
  weekendDays={[5]}
/>

Also included

Same surface as @mantine/dates:

  • MonthPicker / MonthPickerInput
  • YearPicker / YearPickerInput
  • TimePicker / TimeInput / TimeGrid
  • InlineDateTimePicker
  • MiniCalendar
  • Calendar, DatesProvider, …

Migrating from @mantine/dates

- import { DateInput, DatesProvider } from '@mantine/dates';
- import '@mantine/dates/styles.css';
+ import { DateInput, DatesProvider } from 'mantine-datepicker-persian';
+ import 'mantine-datepicker-persian/styles.css';
  1. Uninstall @mantine/dates
  2. Install mantine-datepicker-persian
  3. Replace imports and CSS path
  4. Set locale="fa" (component prop and/or DatesProvider)

Props and behavior match @mantine/dates 9.x. Jalali mode activates only for fa / fa-IR.


Jalali behavior notes

  • Display uses the Persian calendar (month names, day numbers, year).
  • Stored values stay Gregorian YYYY-MM-DD so APIs and databases keep working.
  • Time fields stay LTR (HH:mm) even inside RTL layouts.
  • Persian digits in time inputs are accepted and normalized.

License

MIT