fix datetime show in ui is show as utc time instead of local time

This commit is contained in:
geekgeekrun
2024-12-28 10:11:12 +08:00
parent 54eaa00b67
commit 8e7ae48fb3
5 changed files with 19 additions and 8 deletions

7
packages/utils/date.mjs Normal file
View File

@@ -0,0 +1,7 @@
import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'
dayjs.extend(utc)
export const transformUtcDateToLocalDate = (utcString) => {
return dayjs.utc(utcString).local()
}