Skip to content

Commit

Permalink
Sort detection marks in candidate page by timestamp (#688)
Browse files Browse the repository at this point in the history
  • Loading branch information
skanderm authored Nov 1, 2024
1 parent 8ef4852 commit 1c1de4d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ui/src/components/DetectionsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ export default function DetectionsTable({
<DetectionsPlayer
feed={feed}
marks={detections
.sort((a, b) => a.id.localeCompare(b.id))
.sort(({ timestamp: a }, { timestamp: b }) => {
const date_a = new Date(a);
const date_b = new Date(b);

// Sort by timestamp, low to high
return +date_a - +date_b;
})
.map((d, index) => ({
label: (index + 1).toString(),
value: Number((+d.playerOffset - +startOffset).toFixed(1)),
Expand Down

0 comments on commit 1c1de4d

Please sign in to comment.