mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
use available dateLocale
This commit is contained in:
parent
9b501d03e9
commit
eec871dc4a
2 changed files with 6 additions and 8 deletions
|
|
@ -12,11 +12,10 @@ import { startOfMonth, endOfMonth } from 'date-fns';
|
|||
import Icons from 'components/icons';
|
||||
import { useLocale } from 'components/hooks';
|
||||
import { formatDate } from 'lib/date';
|
||||
import { getDateLocale } from 'lib/lang';
|
||||
import styles from './MonthSelect.module.css';
|
||||
|
||||
export function MonthSelect({ date = new Date(), onChange }) {
|
||||
const { locale } = useLocale();
|
||||
const { locale, dateLocale } = useLocale();
|
||||
const month = formatDate(date, 'MMMM', locale);
|
||||
const year = date.getFullYear();
|
||||
const ref = useRef();
|
||||
|
|
@ -40,7 +39,7 @@ export function MonthSelect({ date = new Date(), onChange }) {
|
|||
{close => (
|
||||
<CalendarMonthSelect
|
||||
date={date}
|
||||
locale={getDateLocale(locale)}
|
||||
locale={dateLocale}
|
||||
onSelect={handleChange.bind(null, close)}
|
||||
/>
|
||||
)}
|
||||
|
|
@ -57,7 +56,7 @@ export function MonthSelect({ date = new Date(), onChange }) {
|
|||
{close => (
|
||||
<CalendarYearSelect
|
||||
date={date}
|
||||
locale={getDateLocale(locale)}
|
||||
locale={dateLocale}
|
||||
onSelect={handleChange.bind(null, close)}
|
||||
/>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue