Changing the DayjsTransformer to transform from plain date string to dayjs in correct timezone
This commit is contained in:
parent
82ff838359
commit
5b109226e6
1 changed files with 2 additions and 2 deletions
|
|
@ -45,7 +45,7 @@ const dayjsTz = (
|
||||||
export const DayjsTransformer = ({ value, type }: TransformFnParams) => {
|
export const DayjsTransformer = ({ value, type }: TransformFnParams) => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case TransformationType.PLAIN_TO_CLASS:
|
case TransformationType.PLAIN_TO_CLASS:
|
||||||
return dayjs(value)
|
return dayjsTz(value)
|
||||||
case TransformationType.CLASS_TO_PLAIN:
|
case TransformationType.CLASS_TO_PLAIN:
|
||||||
return value.format()
|
return value.format()
|
||||||
default:
|
default:
|
||||||
|
|
@ -55,7 +55,7 @@ export const DayjsTransformer = ({ value, type }: TransformFnParams) => {
|
||||||
|
|
||||||
export const DayjsColumnTransformer = {
|
export const DayjsColumnTransformer = {
|
||||||
to: (value: dayjs.Dayjs) => value.format(),
|
to: (value: dayjs.Dayjs) => value.format(),
|
||||||
from: (value: Date) => dayjs(value),
|
from: (value: Date) => dayjsTz(value),
|
||||||
}
|
}
|
||||||
|
|
||||||
export default dayjsTz
|
export default dayjsTz
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue