Skip to content

Commit

Permalink
fix(user & domain): fixing invalid date (#2465)
Browse files Browse the repository at this point in the history
fixing invalid date on users and domains tab

Will close : zesty-io/manager-ui#2716
  • Loading branch information
glespinosa authored Jun 10, 2024
1 parent c2108cc commit d0a85fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/components/accounts/domains/DomainListings.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ export default function DomainListings({
renderCell: (params) => {
return (
<Typography variant="body2">
{dayjs(params.row.createdAt).format('MMM DD, YYYY')}
{!dayjs(params.row.createdAt).isValid()
? ''
: dayjs(params.row.createdAt).format('MMM DD, YYYY')}
</Typography>
);
},
Expand Down
4 changes: 3 additions & 1 deletion src/views/accounts/instances/Users.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ const CustomTable = ({
editable: false,
renderHeader: () => <AccountsTableHead>Last Active</AccountsTableHead>,
renderCell: (params) => {
const date = dayjs(params.row.lastLogin).format('MMM DD, YYYY');
const date = !dayjs(params.row.lastLogin).isValid()
? ''
: dayjs(params.row.lastLogin).format('MMM DD, YYYY');
return (
<Typography variant="body2" color={'text.secondary'}>
{date}
Expand Down

0 comments on commit d0a85fc

Please sign in to comment.