From a0126ad64a0c5261b0a53cf5a17fd67a363700c7 Mon Sep 17 00:00:00 2001 From: glespinosa Date: Thu, 6 Jun 2024 06:40:21 +0800 Subject: [PATCH] fix(fixing invalid date on users and domains tab): fixing invalid date on users and domains tab fixing invalid date on users and domains tab --- src/components/accounts/domains/DomainListings.js | 4 +++- src/views/accounts/instances/Users.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/accounts/domains/DomainListings.js b/src/components/accounts/domains/DomainListings.js index 9aa0ef5a8..e939ef546 100644 --- a/src/components/accounts/domains/DomainListings.js +++ b/src/components/accounts/domains/DomainListings.js @@ -107,7 +107,9 @@ export default function DomainListings({ renderCell: (params) => { return ( - {dayjs(params.row.createdAt).format('MMM DD, YYYY')} + {!dayjs(params.row.createdAt).isValid() + ? '' + : dayjs(params.row.createdAt).format('MMM DD, YYYY')} ); }, diff --git a/src/views/accounts/instances/Users.js b/src/views/accounts/instances/Users.js index 66fbadb8c..369069a32 100644 --- a/src/views/accounts/instances/Users.js +++ b/src/views/accounts/instances/Users.js @@ -152,7 +152,9 @@ const CustomTable = ({ editable: false, renderHeader: () => Last Active, 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 ( {date}