fix: applied timezone to default values, removed value nesting
This commit is contained in:
@ -7,6 +7,7 @@ import { Box } from "@mantine/core";
|
||||
import useIsMobile from "@/hooks/utils/useIsMobile";
|
||||
import { ModuleAttributeSchema } from "@/lib/client";
|
||||
import {
|
||||
naiveDateTimeStringToUtc,
|
||||
utcDateTimeToLocalString,
|
||||
utcDateToLocalString,
|
||||
} from "@/utils/datetime";
|
||||
@ -32,12 +33,14 @@ const useAttributesInnerTableColumns = () => {
|
||||
accessor: "defaultValue",
|
||||
render: attr => {
|
||||
if (!attr.defaultValue) return <>-</>;
|
||||
const value = attr.defaultValue.value;
|
||||
const value = attr.defaultValue;
|
||||
if (value === null) return <>-</>;
|
||||
|
||||
const type = attr.type.type;
|
||||
if (type === "datetime") {
|
||||
return utcDateTimeToLocalString(value as string);
|
||||
return utcDateTimeToLocalString(
|
||||
naiveDateTimeStringToUtc(value as string)
|
||||
);
|
||||
}
|
||||
if (type === "date") {
|
||||
return utcDateToLocalString(value as string);
|
||||
|
||||
Reference in New Issue
Block a user