From 6fcc3716e83d01d7741389fd9afe966375708c57 Mon Sep 17 00:00:00 2001 From: Ramiro Vazquez Date: Tue, 28 Apr 2020 10:03:39 -0300 Subject: [PATCH] make date column sortable --- src/components/List/helpers.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/List/helpers.tsx b/src/components/List/helpers.tsx index a425eec..069be3a 100644 --- a/src/components/List/helpers.tsx +++ b/src/components/List/helpers.tsx @@ -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