Skip to content

Commit c80b6e7

Browse files
committed
refactor: update time handling in DeploymentsTableDeployedAtCellComponent and change comparator to dateComparatorBySortOrder
1 parent b725ca0 commit c80b6e7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Pages/ChartStore/ChartDetails/ChartDetailsTableComponents.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ import {
1010
ButtonStyleType,
1111
ButtonVariantType,
1212
ComponentSizeType,
13+
dateComparatorBySortOrder,
1314
handleAnalyticsEvent,
15+
handleUTCTime,
1416
Icon,
1517
ImageWithFallback,
1618
PortalContainer,
@@ -264,7 +266,7 @@ const DeploymentsTableDeployedByCellComponent = ({ row }: DeploymentsTableCellCo
264266
const DeploymentsTableDeployedAtCellComponent = ({ row }: DeploymentsTableCellComponentProps) => {
265267
const { deployedAt } = row.data
266268

267-
return <span className="flex left fs-13 lh-20 cn-9">{deployedAt ? moment(deployedAt).fromNow() : '-'}</span>
269+
return <span className="flex left fs-13 lh-20 cn-9">{handleUTCTime(deployedAt, true) || '-'}</span>
268270
}
269271

270272
const DeploymentsTableActionMenuCellComponent = ({ row, onDelete }: DeploymentsTableCellComponentProps) => {
@@ -373,7 +375,7 @@ export const DEPLOYMENTS_TABLE_COLUMNS: DeploymentsTableProps['columns'] = [
373375
},
374376
CellComponent: DeploymentsTableDeployedAtCellComponent,
375377
isSortable: true,
376-
comparator: stringComparatorBySortOrder,
378+
comparator: dateComparatorBySortOrder,
377379
} as DeploymentsTableProps['columns'][0],
378380
{
379381
field: 'actionMenu',

0 commit comments

Comments
 (0)