mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-18 15:23:38 +01:00
feature(calendar): use locale for start of week
This commit is contained in:
parent
405766d829
commit
17836c70e7
@ -20,6 +20,7 @@ import Button from './Button';
|
|||||||
import useLocale from 'hooks/useLocale';
|
import useLocale from 'hooks/useLocale';
|
||||||
import { dateFormat } from 'lib/date';
|
import { dateFormat } from 'lib/date';
|
||||||
import { chunk } from 'lib/array';
|
import { chunk } from 'lib/array';
|
||||||
|
import { dateLocales } from 'lib/lang';
|
||||||
import Chevron from 'assets/chevron-down.svg';
|
import Chevron from 'assets/chevron-down.svg';
|
||||||
import Cross from 'assets/times.svg';
|
import Cross from 'assets/times.svg';
|
||||||
import styles from './Calendar.module.css';
|
import styles from './Calendar.module.css';
|
||||||
@ -105,8 +106,8 @@ export default function Calendar({ date, minDate, maxDate, onChange }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const DaySelector = ({ date, minDate, maxDate, locale, onSelect }) => {
|
const DaySelector = ({ date, minDate, maxDate, locale, onSelect }) => {
|
||||||
const startWeek = startOfWeek(date);
|
const startWeek = startOfWeek(date, { locale: dateLocales[locale] });
|
||||||
const startMonth = startOfMonth(date);
|
const startMonth = startOfMonth(date, { locale: dateLocales[locale] });
|
||||||
const startDay = subDays(startMonth, startMonth.getDay());
|
const startDay = subDays(startMonth, startMonth.getDay());
|
||||||
const month = date.getMonth();
|
const month = date.getMonth();
|
||||||
const year = date.getFullYear();
|
const year = date.getFullYear();
|
||||||
|
Loading…
Reference in New Issue
Block a user