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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -44,6 +44,7 @@ _This release is scheduled to be released on 2024-10-01._
- [tests] Fixes calendar test by moving it from e2e to electron with fixed date (#3532) - [tests] Fixes calendar test by moving it from e2e to electron with fixed date (#3532)
- [calendar] fixed sliceMultiDayEvents getting wrong count and displaying incorrect entries, Europe/Berlin (#3542) - [calendar] fixed sliceMultiDayEvents getting wrong count and displaying incorrect entries, Europe/Berlin (#3542)
- [tests] ignore `js/positions.js` when linting (this file is created at runtime) - [tests] ignore `js/positions.js` when linting (this file is created at runtime)
- [calendar] fixed sliceMultiDayEvents showing previous day without config enabled
## [2.28.0] - 2024-07-01 ## [2.28.0] - 2024-07-01

View File

@ -651,7 +651,7 @@ Module.register("calendar", {
const thisEvent = JSON.parse(JSON.stringify(event)); // clone object const thisEvent = JSON.parse(JSON.stringify(event)); // clone object
thisEvent.today = thisEvent.startDate >= today && thisEvent.startDate < today + ONE_DAY; 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.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})`; thisEvent.title += ` (${count}/${maxCount})`;
splitEvents.push(thisEvent); splitEvents.push(thisEvent);