Skip to content

Comparison with alternatives โ€‹

The existing set of Jalali and Persian calendar tools for JavaScript is split across many small packages, each covering one or two needs well and staying silent on the rest. No single one covers all of: a maintained TypeScript-first conversion core, an explicit date/time/timezone precision model, bindings for more than one framework, built-in English and Farsi support, and a headless, themeable component layer with visual regression tests in CI.

๐ŸŸข good ยท ๐ŸŸก partial ยท ๐Ÿ”ด missing or a real drawback

LibraryPrimary useTS-nativeMulti-calendar designDate/time/timezone modelEnglish and FarsiFramework bindingsHeadless and themeable UI
jalali-jsConversion core + bindings + UI๐ŸŸข Yes๐ŸŸข Yes (plugin interface)๐ŸŸข Explicit tiers: CalendarDate, CalendarDateTime, ZonedCalendarDateTime๐ŸŸข Yes๐ŸŸข React, Vue, and framework-free Web Components๐ŸŸข Headless primitives, styled DatePicker on top
jalaali-jsJalali-to-Gregorian math๐ŸŸข Yes๐Ÿ”ด No, one calendar๐Ÿ”ด No, plain numbers๐Ÿ”ด No๐Ÿ”ด No๐Ÿ”ด No
moment-jalaaliJalali plugin for Moment๐Ÿ”ด No๐Ÿ”ด No๐Ÿ”ด Through Moment, which its own team calls legacy๐ŸŸก Partial๐Ÿ”ด No๐Ÿ”ด No
jalali-momentJalali fork of Moment๐Ÿ”ด No๐Ÿ”ด No๐Ÿ”ด Through Moment, which its own team calls legacy๐ŸŸก Partial๐Ÿ”ด No๐Ÿ”ด No
date-fns-jalaliFull date-fns API, Jalali flavor๐ŸŸข Yes๐Ÿ”ด No, one calendar๐ŸŸก Through date-fns, no explicit precision types๐Ÿ”ด No๐Ÿ”ด No๐Ÿ”ด No
dayjs + jalalidayJalali plugin for Day.js๐ŸŸก Partial๐Ÿ”ด No๐ŸŸก Through Day.js๐Ÿ”ด No๐Ÿ”ด No๐Ÿ”ด No
persian-datePersian date object๐Ÿ”ด No๐Ÿ”ด No๐Ÿ”ด No๐ŸŸก Partial๐Ÿ”ด No๐Ÿ”ด No
react-multi-date-pickerReact date picker UI๐ŸŸข Yes๐ŸŸข Yes, several calendars๐Ÿ”ด No explicit model๐ŸŸข Yes๐ŸŸก React only๐Ÿ”ด Tied to the UI, not headless
vue-persian-datetime-pickerVue date picker UI๐Ÿ”ด No๐Ÿ”ด No๐Ÿ”ด Through moment-jalaali๐ŸŸก Partial๐ŸŸก Vue only๐Ÿ”ด Tied to the UI, not headless

Prefer jalali-js for new work. It is the only green row across every column.

  • Math only: still prefer jalali-js core over jalaali-js.
  • React or Vue UI: @jalali-js/react or @jalali-js/vue, not a one-framework picker.
  • No framework: @jalali-js/web.
  • Skip moment-jalaali and jalali-moment for new work.

Two patterns repeat across the alternatives. First, several depend on Moment.js, and the Moment.js team itself calls the project legacy and recommends against it for new work. Second, the packages with strong UI components tie the date logic to one framework, so a team can't take the conversion engine without the component tree, or the other way around.

jalali-js splits on that second point deliberately: one small, framework-agnostic, dependency-free core (jalali-js) does the conversion work; thin framework bindings (@jalali-js/react, @jalali-js/vue, and @jalali-js/web) sit on top of it; a headless component layer sits on top of that. @jalali-js/web is plain Web Components, not a React or Vue wrapper, so it needs no framework at all and drops into any of them the same way any other HTML element does. The same core can power a React admin dashboard, a Vue or Nuxt storefront, a plain HTML page, and a TypeScript backend job, with no wasted code in any of them.

What jalali-js explicitly does not do โ€‹

  • General date math. Not a replacement for date-fns or Temporal. jalali-js has zero runtime dependencies and reads/returns plain Date objects, ISO strings, and epoch numbers; use date-fns or Temporal beside it for date math it doesn't cover, such as adding business days.
  • Database storage format. jalali-js doesn't decide how your application stores a date in its own schema. It only decides what value a component hands back by default (see Display value vs. storage value), and makes that value calendar-agnostic, so the common case needs no extra thought.