From f8397e70efcdad1d48c4999d609d786ed8ab988b Mon Sep 17 00:00:00 2001 From: Simon Mangel Date: Fri, 28 Jul 2023 13:49:11 +0200 Subject: [PATCH] webui: Add custom sorting for timestamp column --- webui/src/PageDataList.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/webui/src/PageDataList.js b/webui/src/PageDataList.js index c177158d..7be950ca 100644 --- a/webui/src/PageDataList.js +++ b/webui/src/PageDataList.js @@ -19,7 +19,14 @@ export default class PageDataList extends React.Component { Cell: cell => { return fmt_date_unix( cell.original.timestamp.secs ); }, - maxWidth: 200 + maxWidth: 200, + accessor: d => d.timestamp, + sortMethod: (a, b) => { + if (a.secs === b.secs) { + return a.fract_nsecs > b.fract_nsecs ? 1 : -1; + } + return a.secs > b.secs ? 1 : -1; + } }, { Header: "Binary",