mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-29 04:29:41 +00:00
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:
parent
d3187689f0
commit
2e6e86887b
@ -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
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user