Skip to content

Commit

Permalink
add end time to sort
Browse files Browse the repository at this point in the history
  • Loading branch information
amykapernick committed Jul 29, 2024
1 parent f4d3e14 commit 999a8b5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion utils/formatRunsheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,12 @@ const formatRunsheet = (props: formatRunsheetProps) =>

Object.values(formattedEvents).forEach((sheet) =>
{
sheet.events.sort((a, b) => a.start.getTime() - b.start.getTime())
sheet.events.sort((a, b) =>
{
if (a.end && b.end) return a.end.getTime() - b.end.getTime()
else if (a.end) return -1
else if (b.end) return 1
})
})

return formattedEvents
Expand Down

0 comments on commit 999a8b5

Please sign in to comment.