Adding log to custom dayjs wrapper
This commit is contained in:
parent
5edf0eac68
commit
fb817610e6
1 changed files with 2 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ import isSameOrBefore from 'dayjs/plugin/isSameOrBefore'
|
||||||
import utc from 'dayjs/plugin/utc'
|
import utc from 'dayjs/plugin/utc'
|
||||||
import timezone from 'dayjs/plugin/timezone'
|
import timezone from 'dayjs/plugin/timezone'
|
||||||
import 'dayjs/locale/nl'
|
import 'dayjs/locale/nl'
|
||||||
|
import { asyncLocalStorage } from './logger'
|
||||||
|
|
||||||
dayjs.extend(isSameOrBefore)
|
dayjs.extend(isSameOrBefore)
|
||||||
dayjs.extend(utc)
|
dayjs.extend(utc)
|
||||||
|
|
@ -14,6 +15,7 @@ dayjs.tz.setDefault('Europe/Amsterdam')
|
||||||
const dayjsTz = (
|
const dayjsTz = (
|
||||||
date?: string | number | Date | dayjs.Dayjs | null | undefined
|
date?: string | number | Date | dayjs.Dayjs | null | undefined
|
||||||
) => {
|
) => {
|
||||||
|
asyncLocalStorage.getStore()?.debug(`<dayjs> timezoning ${date}`)
|
||||||
return dayjs(date).tz()
|
return dayjs(date).tz()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue