Choose a calendar
Pick a built-in calendar adapter, then set its display locale.
Use this page after your first picker when you need
Gregorian, Jalali/Persian, Hijri, or Thai Buddhist dates. Import one exported
adapter and pass it to a component; then use locale for language, digits, and
direction.
Calix keeps calendar behavior behind CalendarAdapter. Components never need to
know how a month rolls over, which digits a locale uses, or how to parse a
date—those are adapter responsibilities.
At the React boundary, values are JavaScript Date objects. Within the core,
an adapter works with calendar-neutral parts:
Built-in adapters
All four are stateless singletons. Reuse the exported adapter everywhere; locale is
always passed to the component rather than stored on the adapter. One Gregorian
adapter can therefore serve en-US, en-GB, and fr-FR at the same time.
The Hijri adapter uses the platform ICU islamic-umalqura calendar, so it ships
without date tables. The Thai Buddhist adapter uses Gregorian month/day rules and
represents years in Buddhist Era (BE = CE + 543).
For week starts, custom labels, RTL, and runtime locale changes, continue to Localization. Only implement a custom adapter when none of these built-ins fits your calendar system.
Adapter responsibilities
Implement a custom adapter when the bundled calendars do not cover your system.
CalendarAdapter includes:
- conversion between
CalendarDateand local JavaScriptDate; - arithmetic (
addDays,addMonths,addYears) and month boundaries; - month-grid and week-number support;
- comparison and equality;
- localized month, weekday, and era names;
- parsing, formatting, and RTL detection.
The @alydev/core helpers can do the generic parts:
Use CalendarAdapter in the API reference
as the definitive method list. The repository's adapter architecture
explains the design decisions.
Time zones
Calix uses local JavaScript Date conversion at its public boundary. It is a
date/time picker, not a time-zone conversion library. If your application
stores instants in UTC, convert at your application boundary and keep the
calendar's selected local date separate from server serialization.