From 36c825a6ac34ffa5601fa209568ecb64e310f0f7 Mon Sep 17 00:00:00 2001 From: anfbermudezme Date: Fri, 8 Sep 2023 12:22:41 +0200 Subject: [PATCH] fix: default value for first access, last access and created. --- .../Students/StudentsTable/columns.jsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/features/Students/StudentsTable/columns.jsx b/src/features/Students/StudentsTable/columns.jsx index f33d7b97..9ab396e2 100644 --- a/src/features/Students/StudentsTable/columns.jsx +++ b/src/features/Students/StudentsTable/columns.jsx @@ -32,17 +32,29 @@ const getColumns = props => [ { Header: 'Created', accessor: 'created', - Cell: ({ row }) => new Date(row.values.created).toUTCString(), + Cell: ({ row }) => ( + row.values.created + ? new Date(row.values.created).toUTCString() + : '' + ), }, { Header: 'First Access', accessor: 'first_access', - Cell: ({ row }) => new Date(row.values.first_access).toUTCString(), + Cell: ({ row }) => ( + row.values.first_access + ? new Date(row.values.first_access).toUTCString() + : '' + ), }, { Header: 'Last Access', accessor: 'last_access', - Cell: ({ row }) => new Date(row.values.last_access).toUTCString(), + Cell: ({ row }) => ( + row.values.last_access + ? new Date(row.values.last_access).toUTCString() + : '' + ), }, { Header: 'Grade',