Skip to content

Commit

Permalink
[DOP-22426] add dayjs
Browse files Browse the repository at this point in the history
  • Loading branch information
Zabilsya committed Dec 13, 2024
1 parent 67e6fda commit 8d2c5a2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"antd": "4.24.13",
"axios": "1.7.7",
"clsx": "2.1.1",
"dayjs": "1.11.13",
"dotenv-webpack": "8.1.0",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
7 changes: 3 additions & 4 deletions src/features/run/RunDetailInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Descriptions } from 'antd';
import { Link } from 'react-router-dom';
import { RunStatusBadge } from '@entities/run';
import { Typography } from 'antd';
import dayjs from 'dayjs';

const { Text } = Typography;

Expand All @@ -18,12 +19,10 @@ export const RunDetailInfo = ({ run, transfer, ...props }: RunDetailInfoProps) =
<RunStatusBadge status={run.status} />
</Descriptions.Item>
<Descriptions.Item label="Started at" span={3}>
{/* //TODO: [DOP-20067] Rewrite on dayjs when "started_at" field will have not null value */}
{run.started_at || ''}
{run.started_at ? dayjs(run.started_at).format('DD-MM-YYYY HH:mm:ss') : ''}
</Descriptions.Item>
<Descriptions.Item label="Ended at" span={3}>
{/* //TODO: [DOP-20067] Rewrite on dayjs when "ended_at" field will have not null value */}
{run.ended_at || ''}
{run.ended_at ? dayjs(run.ended_at).format('DD-MM-YYYY HH:mm:ss') : ''}
</Descriptions.Item>
<Descriptions.Item label="Log url" span={3}>
{run.log_url ? (
Expand Down
11 changes: 6 additions & 5 deletions src/features/run/RunList/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { TableColumns } from '@shared/ui';
import { Run, RunStatusBadge } from '@entities/run';
import { Typography } from 'antd';
import { Link } from 'react-router-dom';
import dayjs from 'dayjs';

const { Text } = Typography;

Expand All @@ -12,7 +13,7 @@ export const RUN_LIST_COLUMNS: TableColumns<PaginationResponse<Run>> = [
title: 'Id',
dataIndex: 'id',
render: (id, record) => <Link to={`/transfers/runs/${record.id}`}>{id}</Link>,
width: 150,
width: 80,
},
{
title: 'Status',
Expand All @@ -23,14 +24,14 @@ export const RUN_LIST_COLUMNS: TableColumns<PaginationResponse<Run>> = [
{
title: 'Started at',
dataIndex: 'started_at',
//TODO: [DOP-20067] Rewrite on dayjs when "started_at" field will have not null value
width: 150,
render: (value, record) => (record.started_at ? dayjs(record.started_at).format('DD-MM-YYYY HH:mm:ss') : ''),
width: 180,
},
{
title: 'Ended at',
dataIndex: 'ended_at',
//TODO: [DOP-20067] Rewrite on dayjs when "ended_at" field will have not null value
width: 150,
render: (value, record) => (record.ended_at ? dayjs(record.ended_at).format('DD-MM-YYYY HH:mm:ss') : ''),
width: 180,
},
{
title: 'Log url',
Expand Down
3 changes: 2 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4000,7 +4000,7 @@ __metadata:
languageName: node
linkType: hard

"dayjs@npm:1.x":
"dayjs@npm:1.11.13, dayjs@npm:1.x":
version: 1.11.13
resolution: "dayjs@npm:1.11.13"
checksum: 10c0/a3caf6ac8363c7dade9d1ee797848ddcf25c1ace68d9fe8678ecf8ba0675825430de5d793672ec87b24a69bf04a1544b176547b2539982275d5542a7955f35b7
Expand Down Expand Up @@ -9956,6 +9956,7 @@ __metadata:
cross-env: "npm:7.0.3"
css-loader: "npm:6.10.0"
css-minimizer-webpack-plugin: "npm:6.0.0"
dayjs: "npm:1.11.13"
dotenv-webpack: "npm:8.1.0"
eslint: "npm:8.57.0"
eslint-config-airbnb: "npm:19.0.4"
Expand Down

0 comments on commit 8d2c5a2

Please sign in to comment.