fix calendar showing previous day when using sliceMultiDayEvents (#3555)

This bug is caused by #3543.

The calculation for midnight adds a day but for endDate we want the day
to be subtracted again.
This commit is contained in:
Marc Landis
2024-09-25 21:16:43 +02:00
committed by GitHub
parent d3187689f0
commit 2e6e86887b
2 changed files with 2 additions and 1 deletions

View File

@@ -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);