Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Brian Cao 2023-08-15 10:57:34 -07:00
commit 14df1e5a29
9 changed files with 46 additions and 16 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) {