diff --git a/src/FilterLists.Web/ClientApp/components/Home.tsx b/src/FilterLists.Web/ClientApp/components/Home.tsx index 71ad27e56..c214e2d5f 100644 --- a/src/FilterLists.Web/ClientApp/components/Home.tsx +++ b/src/FilterLists.Web/ClientApp/components/Home.tsx @@ -98,7 +98,9 @@ export class Home extends React.Component, IHomeState> { accessor: "updatedDate", filterable: true, filterMethod: (filter: any, row: any) => row[filter.id].includes(filter.value), - sortMethod: (a: any, b: any) => a > b ? 1 : -1, + sortMethod: (a: any, b: any) => moment(a).isValid() + ? (moment(b).isValid() ? (moment(a).isBefore(b) ? -1 : 1) : 1) + : -1, Cell: (cell: any) =>
{moment(cell.value).isValid() ? moment(cell.value).format(moment.HTML5_FMT.DATE) : "N/A"}
,