Skip to content

Commit

Permalink
Fix multiday
Browse files Browse the repository at this point in the history
  • Loading branch information
vicb committed Mar 10, 2024
1 parent f452a30 commit 18e92f6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions apps/fxc-front/src/app/redux/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ export const isMultiDay = createSelector(tracks, (tracks): boolean => {
if (tracks.length == 0) {
return false;
}
const minTime = Math.min(...tracks.map((t) => t.minTimeSec));
const maxTime = Math.max(...tracks.map((t) => t.maxTimeSec));
return maxTime - minTime > 12 * 3600;
const startTimesSec = tracks.map((t) => t.minTimeSec);
const minTimeSec = Math.min(...startTimesSec);
const maxTimeSec = Math.max(...startTimesSec);
return maxTimeSec - minTimeSec > 12 * 3600;
});

// Offset to subtract to each track timestamp to have them started at the same time as the current one.
Expand Down

0 comments on commit 18e92f6

Please sign in to comment.