Skip to content

Commit 5c219f9

Browse files
author
Zabilsya
committed
[DOP-22426] add dayjs
1 parent 11aaa43 commit 5c219f9

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"antd": "4.24.13",
2424
"axios": "1.7.7",
2525
"clsx": "2.1.1",
26+
"dayjs": "1.11.13",
2627
"dotenv-webpack": "8.1.0",
2728
"react": "18.2.0",
2829
"react-dom": "18.2.0",

src/features/run/RunDetailInfo/index.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Descriptions } from 'antd';
33
import { Link } from 'react-router-dom';
44
import { RunStatusBadge } from '@entities/run';
55
import { Typography } from 'antd';
6+
import dayjs from 'dayjs';
67

78
const { Text } = Typography;
89

@@ -18,12 +19,10 @@ export const RunDetailInfo = ({ run, transfer, ...props }: RunDetailInfoProps) =
1819
<RunStatusBadge status={run.status} />
1920
</Descriptions.Item>
2021
<Descriptions.Item label="Started at" span={3}>
21-
{/* //TODO: [DOP-20067] Rewrite on dayjs when "started_at" field will have not null value */}
22-
{run.started_at || ''}
22+
{run.started_at ? dayjs(run.started_at).format('DD-MM-YYYY HH:mm:ss') : ''}
2323
</Descriptions.Item>
2424
<Descriptions.Item label="Ended at" span={3}>
25-
{/* //TODO: [DOP-20067] Rewrite on dayjs when "ended_at" field will have not null value */}
26-
{run.ended_at || ''}
25+
{run.ended_at ? dayjs(run.ended_at).format('DD-MM-YYYY HH:mm:ss') : ''}
2726
</Descriptions.Item>
2827
<Descriptions.Item label="Log url" span={3}>
2928
{run.log_url ? (

src/features/run/RunList/constants.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { TableColumns } from '@shared/ui';
44
import { Run, RunStatusBadge } from '@entities/run';
55
import { Typography } from 'antd';
66
import { Link } from 'react-router-dom';
7+
import dayjs from 'dayjs';
78

89
const { Text } = Typography;
910

@@ -12,7 +13,7 @@ export const RUN_LIST_COLUMNS: TableColumns<PaginationResponse<Run>> = [
1213
title: 'Id',
1314
dataIndex: 'id',
1415
render: (id, record) => <Link to={`/transfers/runs/${record.id}`}>{id}</Link>,
15-
width: 150,
16+
width: 80,
1617
},
1718
{
1819
title: 'Status',
@@ -23,14 +24,14 @@ export const RUN_LIST_COLUMNS: TableColumns<PaginationResponse<Run>> = [
2324
{
2425
title: 'Started at',
2526
dataIndex: 'started_at',
26-
//TODO: [DOP-20067] Rewrite on dayjs when "started_at" field will have not null value
27-
width: 150,
27+
render: (value, record) => (record.started_at ? dayjs(record.started_at).format('DD-MM-YYYY HH:mm:ss') : ''),
28+
width: 180,
2829
},
2930
{
3031
title: 'Ended at',
3132
dataIndex: 'ended_at',
32-
//TODO: [DOP-20067] Rewrite on dayjs when "ended_at" field will have not null value
33-
width: 150,
33+
render: (value, record) => (record.ended_at ? dayjs(record.ended_at).format('DD-MM-YYYY HH:mm:ss') : ''),
34+
width: 180,
3435
},
3536
{
3637
title: 'Log url',

yarn.lock

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4000,7 +4000,7 @@ __metadata:
40004000
languageName: node
40014001
linkType: hard
40024002

4003-
"dayjs@npm:1.x":
4003+
"dayjs@npm:1.11.13, dayjs@npm:1.x":
40044004
version: 1.11.13
40054005
resolution: "dayjs@npm:1.11.13"
40064006
checksum: 10c0/a3caf6ac8363c7dade9d1ee797848ddcf25c1ace68d9fe8678ecf8ba0675825430de5d793672ec87b24a69bf04a1544b176547b2539982275d5542a7955f35b7
@@ -9956,6 +9956,7 @@ __metadata:
99569956
cross-env: "npm:7.0.3"
99579957
css-loader: "npm:6.10.0"
99589958
css-minimizer-webpack-plugin: "npm:6.0.0"
9959+
dayjs: "npm:1.11.13"
99599960
dotenv-webpack: "npm:8.1.0"
99609961
eslint: "npm:8.57.0"
99619962
eslint-config-airbnb: "npm:19.0.4"

0 commit comments

Comments
 (0)