mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
handle N/A in Updated column sorting
This commit is contained in:
parent
c07f4bf945
commit
68efad8299
1 changed files with 3 additions and 1 deletions
|
|
@ -98,7 +98,9 @@ export class Home extends React.Component<RouteComponentProps<{}>, 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) => <div>{moment(cell.value).isValid()
|
||||
? moment(cell.value).format(moment.HTML5_FMT.DATE)
|
||||
: "N/A"}</div>,
|
||||
|
|
|
|||
Loading…
Reference in a new issue