Skip to content

Commit

Permalink
feat: sort by event end date if start dates are equal
Browse files Browse the repository at this point in the history
  • Loading branch information
Bart van Andel committed Mar 29, 2021
1 parent dbcc578 commit dddf4e1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/eventLevels.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export function sortEvents(evtA, evtB, accessors) {
startSort || // sort by start Day first
Math.max(durB, 1) - Math.max(durA, 1) || // events spanning multiple days go first
!!accessors.allDay(evtB) - !!accessors.allDay(evtA) || // then allDay single day events
+accessors.start(evtA) - +accessors.start(evtB)
) // then sort by start time
+accessors.start(evtA) - +accessors.start(evtB) || // then sort by start time
+accessors.end(evtA) - +accessors.end(evtB) // then sort by end time
)
}

0 comments on commit dddf4e1

Please sign in to comment.