Skip to content

Commit

Permalink
Fix to overnight calendar continous reservation check
Browse files Browse the repository at this point in the history
Previously when overnight start and end time were the same time, continous reservation check would falsely detect next and previous day selections to break continous selection. This change fixes the issue.
  • Loading branch information
SanttuA committed May 30, 2024
1 parent 7069883 commit 93c48e0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/shared/overnight-calendar/overnightUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,10 @@ export function isSelectionContinous({

dates[0] = setDatesTime(dates[0], overnightStartTime).toDate();
dates[dates.length - 1] = setDatesTime(dates[dates.length - 1], overnightEndTime).toDate();
if (overnightStartTime === overnightEndTime) {
dates[0].setMinutes(dates[0].getMinutes() + 1);
dates[dates.length - 1].setMinutes(dates[dates.length - 1].getMinutes() - 1);
}

for (let index = 0; index < dates.length; index += 1) {
const date = dates[index];
Expand Down

0 comments on commit 93c48e0

Please sign in to comment.