mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-07-12 16:01:38 +08:00
fix datetime show in ui is show as utc time instead of local time
This commit is contained in:
7
packages/utils/date.mjs
Normal file
7
packages/utils/date.mjs
Normal 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()
|
||||
}
|
||||
Reference in New Issue
Block a user