Client: Date time zones now handled correctly
This commit is contained in:
10
client/src/pages/vendors/list.tsx
vendored
10
client/src/pages/vendors/list.tsx
vendored
@@ -8,6 +8,10 @@ import {
|
||||
DateField,
|
||||
} from "@refinedev/antd";
|
||||
import { Table, Space } from "antd";
|
||||
import dayjs from "dayjs";
|
||||
import utc from "dayjs/plugin/utc";
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
||||
export const VendorList: React.FC<IResourceComponentsProps> = () => {
|
||||
const { tableProps } = useTable({
|
||||
@@ -23,7 +27,11 @@ export const VendorList: React.FC<IResourceComponentsProps> = () => {
|
||||
dataIndex={["registered"]}
|
||||
title="Registered"
|
||||
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" />
|
||||
|
||||
10
client/src/pages/vendors/show.tsx
vendored
10
client/src/pages/vendors/show.tsx
vendored
@@ -2,6 +2,10 @@ import React from "react";
|
||||
import { IResourceComponentsProps, useShow } from "@refinedev/core";
|
||||
import { Show, NumberField, DateField, TextField } from "@refinedev/antd";
|
||||
import { Typography } from "antd";
|
||||
import dayjs from "dayjs";
|
||||
import utc from "dayjs/plugin/utc";
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
||||
const { Title } = Typography;
|
||||
|
||||
@@ -16,7 +20,11 @@ export const VendorShow: React.FC<IResourceComponentsProps> = () => {
|
||||
<Title level={5}>Id</Title>
|
||||
<NumberField value={record?.id ?? ""} />
|
||||
<Title level={5}>Registered</Title>
|
||||
<DateField value={record?.registered} format="YYYY-MM-DD HH:mm:ss" />
|
||||
<DateField
|
||||
value={dayjs.utc(record?.registered).local()}
|
||||
title={dayjs.utc(record?.registered).local().format()}
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
/>
|
||||
<Title level={5}>Name</Title>
|
||||
<TextField value={record?.name} />
|
||||
<Title level={5}>Comment</Title>
|
||||
|
||||
Reference in New Issue
Block a user