Add timezone to report queries.

This commit is contained in:
Mike Cao 2023-08-14 22:36:18 -07:00
parent 820ad69d60
commit 29a943df9c
7 changed files with 32 additions and 6 deletions

View file

@ -250,9 +250,13 @@ export const customFormats = {
};
export function dateFormat(date, str, locale = 'en-US') {
return format(date, customFormats?.[locale]?.[str] || str, {
locale: getDateLocale(locale),
});
return format(
typeof date === 'string' ? new Date(date) : date,
customFormats?.[locale]?.[str] || str,
{
locale: getDateLocale(locale),
},
);
}
export function maxDate(...args) {