Skip to content

Commit

Permalink
fix calendar showing previous day when using sliceMultiDayEvents
Browse files Browse the repository at this point in the history
This bug is caused by #3543.

The calculation for midnight adds a day but for endDate we want the day to be subtracted again.
  • Loading branch information
MarcLandis committed Sep 24, 2024
1 parent 06a8b51 commit c3bf050
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/default/calendar/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ Module.register("calendar", {
const thisEvent = JSON.parse(JSON.stringify(event)); // clone object
thisEvent.today = thisEvent.startDate >= today && thisEvent.startDate < today + ONE_DAY;
thisEvent.tomorrow = !thisEvent.today && thisEvent.startDate >= today + ONE_DAY && thisEvent.startDate < today + 2 * ONE_DAY;
thisEvent.endDate = midnight;
thisEvent.endDate = moment(midnight, "x").clone().subtract(1, "day").format("x");
thisEvent.title += ` (${count}/${maxCount})`;
splitEvents.push(thisEvent);

Expand Down

0 comments on commit c3bf050

Please sign in to comment.