diff --git a/package.json b/package.json index d6e6155d..d4d8fc9c 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/features/run/RunDetailInfo/index.tsx b/src/features/run/RunDetailInfo/index.tsx index ad196052..d437ac2f 100644 --- a/src/features/run/RunDetailInfo/index.tsx +++ b/src/features/run/RunDetailInfo/index.tsx @@ -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; @@ -18,12 +19,10 @@ export const RunDetailInfo = ({ run, transfer, ...props }: RunDetailInfoProps) = - {/* //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') : ''} - {/* //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') : ''} {run.log_url ? ( diff --git a/src/features/run/RunList/constants.tsx b/src/features/run/RunList/constants.tsx index 5f67ecd7..cfb4c4ce 100644 --- a/src/features/run/RunList/constants.tsx +++ b/src/features/run/RunList/constants.tsx @@ -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; @@ -12,7 +13,7 @@ export const RUN_LIST_COLUMNS: TableColumns> = [ title: 'Id', dataIndex: 'id', render: (id, record) => {id}, - width: 150, + width: 80, }, { title: 'Status', @@ -23,14 +24,14 @@ export const RUN_LIST_COLUMNS: TableColumns> = [ { 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', diff --git a/yarn.lock b/yarn.lock index 6011d9bf..8b58e932 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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 @@ -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"