DatesProvider

Settings provider for @mantine/dates components
Import

Usage

DatesProvider component lets you set various settings that are shared across all components exported from @mantine/dates package. DatesProvider supports the following settings:

  • locale – dayjs locale, note that you also need to import corresponding locale module from dayjs. Default value is en.
  • firstDayOfWeek – number from 0 to 6, where 0 is Sunday and 6 is Saturday. Default value is 1 – Monday.
  • weekendDays – an array of numbers from 0 to 6, where 0 is Sunday and 6 is Saturday. Default value is [0, 6] – Saturday and Sunday.
import 'dayjs/locale/ru';
import { DatesProvider, MonthPickerInput, DatePickerInput } from '@mantine/dates';
function Demo() {
return (
<DatesProvider settings={{ locale: 'ru', firstDayOfWeek: 0, weekendDays: [0] }}>
<MonthPickerInput label="Pick month" placeholder="Pick month" />
<DatePickerInput mt="md" label="Pick date" placeholder="Pick date" />
</DatesProvider>
);
}