diff --git a/packages/frontend/core/src/utils/intl-formatter.ts b/packages/frontend/core/src/utils/intl-formatter.ts index b0ebae97e6..d25de98a78 100644 --- a/packages/frontend/core/src/utils/intl-formatter.ts +++ b/packages/frontend/core/src/utils/intl-formatter.ts @@ -1,3 +1,5 @@ +import dayjs from 'dayjs'; + const timeFormatter = new Intl.DateTimeFormat(undefined, { timeStyle: 'short', }); @@ -9,9 +11,9 @@ const dateFormatter = new Intl.DateTimeFormat(undefined, { }); export const timestampToLocalTime = (ts: string | number) => { - return timeFormatter.format(new Date(ts)); + return timeFormatter.format(dayjs(ts).toDate()); }; export const timestampToLocalDate = (ts: string | number) => { - return dateFormatter.format(new Date(ts)); + return dateFormatter.format(dayjs(ts).toDate()); };