Skip to content

Commit

Permalink
fix: bad component started date (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabio-silva committed Aug 23, 2024
1 parent 65e5cc6 commit fc6a2a9
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { Table } from '@percona/ui-lib';
import { MRT_ColumnDef } from 'material-react-table';
import { DBClusterComponent } from 'shared-types/components.types';
import StatusField from 'components/status-field';
import { format, formatDistanceToNowStrict } from 'date-fns';
import { format, formatDistanceToNowStrict, isValid } from 'date-fns';
import {
COMPONENT_STATUS,
COMPONENT_STATUS_TO_BASE_STATUS,
Expand Down Expand Up @@ -64,7 +64,8 @@ const Components = () => {
accessorKey: 'started',
Cell: ({ cell }) => {
const date = new Date(cell.getValue<string>());
return date ? (

return isValid(date) ? (
<Tooltip
title={`Started at ${format(date, DATE_FORMAT)}`}
placement="right"
Expand Down

0 comments on commit fc6a2a9

Please sign in to comment.