validate moment dates

This commit is contained in:
Collin M. Barrett 2018-06-08 14:41:25 -05:00
parent aaee3326e4
commit 1bfe69502a

View file

@ -100,7 +100,9 @@ export class Home extends React.Component<RouteComponentProps<{}>, 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) => <div>{moment(cell.value).format("M-D-YY")}</div>,
Cell: (cell: any) => <div>{moment(cell.value).isValid()
? moment(cell.value).format("M-D-YY")
: ""}</div>,
style: { whiteSpace: "inherit" },
width: 75,
headerClassName: "d-none d-sm-block",
@ -113,7 +115,9 @@ export class Home extends React.Component<RouteComponentProps<{}>, 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) => <div>{moment(cell.value).format("M-D-YY")}</div>,
Cell: (cell: any) => <div>{moment(cell.value).isValid()
? moment(cell.value).format("M-D-YY")
: ""}</div>,
style: { whiteSpace: "inherit" },
width: 75,
headerClassName: "d-none d-sm-block",