Skip to main content

Changing the Locale

DayPicker can localize month names, weekday labels, and other text using the locales provided by date-fns. All locales are exported from react-day-picker/locale.

By default, DayPicker uses the English (US) locale (en-US). You can override this via the locale prop.

Prop NameTypeDescription
localeLocaleSet the locale. Default is en-US.

For example, to set the calendar to Spanish, import the es locale and pass it to the locale prop:

import { DayPicker } from "react-day-picker";
import { es } from "react-day-picker/locale";

export function Spanish() {
return <DayPicker locale={es} />;
}

Numerals

Use the numerals prop to select the numbering system used by labels and formatters (for example, latn, arab, thai). Locale label translations also respect the numerals you choose.

Prop NameTypeDescription
numeralsNumeralsNumbering system for labels and formatted text.
import { DayPicker } from "react-day-picker";
import { hi } from "react-day-picker/locale";

export function HindiWithDevanagariNumerals() {
return <DayPicker locale={hi} numerals="deva" />;
}

RTL text direction

Set the text direction to right-to-left with the dir prop.

import { arSA } from "react-day-picker/locale";

<DayPicker locale={arSA} dir="rtl" />;

Override week settings

You can override week-related settings even when they differ from the defaults for the current locale.

Prop NameTypeDescription
weekStartsOn0 | 1 | ... | 6First day of the week (0 = Sunday, 1 = Monday, etc.).
firstWeekContainsDate1 | 2 | ... | 7January day that must fall in the first week of the year.
<DayPicker weekStartsOn={1} firstWeekContainsDate={4} />