Upgraded next to 13. Fixed date filter for websites.

This commit is contained in:
Mike Cao 2023-03-08 20:23:32 -08:00
parent 9b90036401
commit 0607e9f442
19 changed files with 201 additions and 296 deletions

View file

@ -26,6 +26,7 @@ import {
differenceInCalendarMonths,
differenceInCalendarYears,
format,
parseISO,
} from 'date-fns';
import { getDateLocale } from 'lib/lang';
@ -38,6 +39,15 @@ export function getLocalTime(t) {
}
export function parseDateRange(value, locale = 'en-US') {
if (typeof value === 'object') {
const { startDate, endDate } = value;
return {
...value,
startDate: typeof startDate === 'string' ? parseISO(startDate) : startDate,
endDate: typeof endDate === 'string' ? parseISO(endDate) : endDate,
};
}
const now = new Date();
const dateLocale = getDateLocale(locale);