Changing the DayjsTransformer to transform from plain date string to dayjs in correct timezone

This commit is contained in:
Collin Duncan 2025-04-03 16:01:34 +02:00
parent 82ff838359
commit 5b109226e6
No known key found for this signature in database

View file

@ -45,7 +45,7 @@ const dayjsTz = (
export const DayjsTransformer = ({ value, type }: TransformFnParams) => {
switch (type) {
case TransformationType.PLAIN_TO_CLASS:
return dayjs(value)
return dayjsTz(value)
case TransformationType.CLASS_TO_PLAIN:
return value.format()
default:
@ -55,7 +55,7 @@ export const DayjsTransformer = ({ value, type }: TransformFnParams) => {
export const DayjsColumnTransformer = {
to: (value: dayjs.Dayjs) => value.format(),
from: (value: Date) => dayjs(value),
from: (value: Date) => dayjsTz(value),
}
export default dayjsTz