Skip to content

Commit

Permalink
make date column sortable
Browse files Browse the repository at this point in the history
  • Loading branch information
ramirotw committed Apr 28, 2020
1 parent 285b1ee commit 6fcc371
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/List/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ export const VoterHistoryColumns = () => {
id: 'date',
separator: true,
disableFilters: true,
sortType: 'datetime',
accessor: 'lastParticipation.timestamp',
sortType: (a, b) => {
return a.original.lastParticipation.timestamp - b.original.lastParticipation.timestamp
},
Cell: ({ row }) => {
if (!row.original.lastParticipation) {
return <Loading />
Expand Down

0 comments on commit 6fcc371

Please sign in to comment.