From 1bfe69502ac9dfc06640ca8eb5361af409067fbd Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Fri, 8 Jun 2018 14:41:25 -0500 Subject: [PATCH] validate moment dates --- src/FilterLists.Web/ClientApp/components/Home.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/FilterLists.Web/ClientApp/components/Home.tsx b/src/FilterLists.Web/ClientApp/components/Home.tsx index 03d9cdd79..816dfdc50 100644 --- a/src/FilterLists.Web/ClientApp/components/Home.tsx +++ b/src/FilterLists.Web/ClientApp/components/Home.tsx @@ -100,7 +100,9 @@ export class Home extends React.Component, IHomeState> { filterMethod: (filter: any, row: any) => row[filter.id].toUpperCase() .includes(filter.value.toUpperCase()), sortMethod: (a: any, b: any) => a > b ? 1 : -1, - Cell: (cell: any) =>
{moment(cell.value).format("M-D-YY")}
, + Cell: (cell: any) =>
{moment(cell.value).isValid() + ? moment(cell.value).format("M-D-YY") + : ""}
, style: { whiteSpace: "inherit" }, width: 75, headerClassName: "d-none d-sm-block", @@ -113,7 +115,9 @@ export class Home extends React.Component, IHomeState> { filterMethod: (filter: any, row: any) => row[filter.id].toUpperCase() .includes(filter.value.toUpperCase()), sortMethod: (a: any, b: any) => a > b ? 1 : -1, - Cell: (cell: any) =>
{moment(cell.value).format("M-D-YY")}
, + Cell: (cell: any) =>
{moment(cell.value).isValid() + ? moment(cell.value).format("M-D-YY") + : ""}
, style: { whiteSpace: "inherit" }, width: 75, headerClassName: "d-none d-sm-block",