Calix

Localization

Locale, direction, digits, week starts, and built-in labels.

Calendar and locale are independent. The adapter determines calendar arithmetic; the BCP-47 locale controls localized names, direction, digits, and the default week layout.

<Calendar adapter={gregorian} locale="en-GB" />
<Calendar adapter={jalali} locale="fa-IR" />

Direction

Calix asks the adapter whether the locale is RTL. You can force the direction when your surrounding UI needs it:

<DatePicker adapter={gregorian} locale="en-US" dir="rtl" />

Horizontal arrow keys are mirrored in RTL so moving to the visual next day still moves forward in time.

Digits and typed input

Adapters format digits for their locale. useDateInput accepts Persian and Arabic-Indic digits as well as Latin digits, normalizing them before parsing.

import { toLocaleDigits, toLatinDigits } from "@alydev/core";
 
toLocaleDigits("2026", "fa-IR"); // "۲۰۲۶"
toLatinDigits("۲۰۲۶"); // "2026"

First day of week

Calix defaults to Saturday for fa-* locales and Sunday otherwise. Override it with weekStartsOn, where 0 is Sunday and 6 is Saturday:

<Calendar adapter={gregorian} locale="en-US" weekStartsOn={1} />

This setting also determines the boundaries selected by mode="week".

Custom labels

labels overrides text in built-in components. You only need to provide the entries you want to replace; missing entries retain their localized defaults.

<DatePicker
  adapter={jalali}
  locale="fa-IR"
  labels={{
    weekdays: ["ش", "ی", "د", "س", "چ", "پ", "ج"],
    previousMonth: "ماه قبل",
    nextMonth: "ماه بعد",
    chooseMonthAndYear: "انتخاب ماه و سال",
    selectTime: "انتخاب ساعت",
    clear: "پاک کردن",
  }}
/>

When supplied, weekdays must contain exactly seven labels in the order you want them displayed.

Runtime switching

Locale and adapter are ordinary props. Changing either re-renders the picker; there is no provider or global configuration to reset. When changing adapters, keep in mind that the public Date value represents the same local date and is interpreted by the new adapter.

On this page