feature(DateFilter): use locale for date ranges

This commit is contained in:
Alexander Klein 2021-03-10 10:22:19 +01:00
parent eb1029bfc8
commit a48c33fcd6

View File

@ -55,6 +55,7 @@ const filterOptions = [
]; ];
function DateFilter({ value, startDate, endDate, onChange, className }) { function DateFilter({ value, startDate, endDate, onChange, className }) {
const [locale] = useLocale();
const [showPicker, setShowPicker] = useState(false); const [showPicker, setShowPicker] = useState(false);
const displayValue = const displayValue =
value === 'custom' ? ( value === 'custom' ? (
@ -68,7 +69,7 @@ function DateFilter({ value, startDate, endDate, onChange, className }) {
setShowPicker(true); setShowPicker(true);
return; return;
} }
onChange(getDateRange(value)); onChange(getDateRange(value, locale));
} }
function handlePickerChange(value) { function handlePickerChange(value) {