From ae25aca0e83f90e1621940401b7c80aa56f236b5 Mon Sep 17 00:00:00 2001 From: andrzej Date: Tue, 25 Jun 2024 12:20:41 +0200 Subject: [PATCH] properly render null date values --- src/app/submission/columns.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/submission/columns.tsx b/src/app/submission/columns.tsx index 7604c5d..18cf273 100644 --- a/src/app/submission/columns.tsx +++ b/src/app/submission/columns.tsx @@ -42,7 +42,7 @@ export const columns: ColumnDef[] = [ cell: props => { return props.getValue().toLocaleDateString() } }, { - accessorFn: row => new Date(row.responded), + accessorFn: row => row.responded ? new Date(row.responded) : null, id: "responded", header: ({ column }) => { return ( @@ -57,7 +57,7 @@ export const columns: ColumnDef[] = [ }, enableColumnFilter: false, sortingFn: "datetime", - cell: props => { return props.getValue().toLocaleDateString() } + cell: props => props.getValue() ? props.getValue().toLocaleDateString() : '-' }, { accessorFn: row => {