Skip to content

Commit

Permalink
fix calendar showing previous day when using sliceMultiDayEvents (#3555)
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 authored Sep 25, 2024
1 parent d318768 commit 2e6e868
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
- [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

Expand Down
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 2e6e868

Please sign in to comment.