From 8958b0d9567b3093b3f994ab6d86465f742aedb4 Mon Sep 17 00:00:00 2001 From: Dirk Rettschlag Date: Tue, 24 Sep 2024 11:43:53 +0200 Subject: [PATCH 1/2] fix calendar showing previous day when using sliceMultiDayEvents This bug is caused by #3543. The calculation for midnight adds a day but for endDate we want the day to be subtracted again. --- modules/default/calendar/calendar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index f952bc5956..31b863eb28 100644 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -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); From e83711a300459cd79d9112cfd8d8ecddd20343f2 Mon Sep 17 00:00:00 2001 From: Dirk Rettschlag Date: Wed, 25 Sep 2024 07:41:17 +0200 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64b69ed09a..2588551526 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,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) - [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) +- [calendar] fixed sliceMultiDayEvents showing previous day without config enabled ## [2.28.0] - 2024-07-01