Client: Date time zones now handled correctly

This commit is contained in:
Donkie
2023-05-18 13:38:38 +02:00
parent 60ea450ce2
commit 646ade1721
7 changed files with 70 additions and 10 deletions

View File

@@ -10,6 +10,10 @@ import {
} from "@refinedev/antd";
import { Table, Space } from "antd";
import { NumberFieldUnit } from "../../components/numberField";
import dayjs from "dayjs";
import utc from "dayjs/plugin/utc";
dayjs.extend(utc);
export const SpoolList: React.FC<IResourceComponentsProps> = () => {
const { tableProps } = useTable({
@@ -68,14 +72,22 @@ export const SpoolList: React.FC<IResourceComponentsProps> = () => {
dataIndex={["first_used"]}
title="First Used"
render={(value) => (
<DateField value={value} format="YYYY-MM-DD HH:mm:ss" />
<DateField
value={dayjs.utc(value).local()}
title={dayjs.utc(value).local().format()}
format="YYYY-MM-DD HH:mm:ss"
/>
)}
/>
<Table.Column
dataIndex={["last_used"]}
title="Last Used"
render={(value) => (
<DateField value={value} format="YYYY-MM-DD HH:mm:ss" />
<DateField
value={dayjs.utc(value).local()}
title={dayjs.utc(value).local().format()}
format="YYYY-MM-DD HH:mm:ss"
/>
)}
/>
<Table.Column dataIndex={["comment"]} title="Comment" />