[Bug] sliceMultiDayEvents: sliced sub-events after the first start at 23:59 instead of next-day 00:00
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- javascript
- Domain
- frontend
Research direction
Open modules/default/calendar/calendar.js and inspect the slicing loop around lines 513–535. Reproduce a multi-day event with sliceMultiDayEvents enabled, then verify that every slice after the first renders with a start time of 00:00 on its own day rather than 23:59 on the previous day.
Written by the indexing model from the issue text.
Description
Platform
- MagicMirror² v2.37.0
- default
calendarmodule,sliceMultiDayEvents: true
Bug
With sliceMultiDayEvents: true, a multi-day event is split into per-day slices (1/n), (2/n), … Every slice after the first is displayed as starting at 23:59 instead of the following day's 00:00.
Cause
modules/default/calendar/calendar.js, in the slicing loop (around L513–535):
let midnight = eventStartDateMoment.clone().startOf("day").add(1, "day").endOf("day");
...
event.startDate = midnight.format("x"); // start of the NEXT slice
...
midnight = midnight.clone().add(1, "day").endOf("day");
midnight is .endOf("day") (= 23:59:59.999), but it is assigned as the following slice's startDate. So each subsequent slice starts at 23:59:59.999 of the previous day instead of 00:00 of its own day, which is what gets rendered as "… 23:59".
Fix
Use the start of the day for the next slice's start:
- event.startDate = midnight.format("x");
+ event.startDate = midnight.clone().startOf("day").format("x");
Reproduce
Any all-day or timed event spanning ≥2 midnights with sliceMultiDayEvents: true; slices 2..n show "… 23:59".
- Dominant language
- JavaScript
- Stars
- 23.9k
- Forks
- 4.6k
- Avg merge
- 17h 31m
- Merged PRs (30d)
- 25
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MagicMirrorOrg/MagicMirror
-
bug ready (coming with next release)
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
MagicMirrorOrg/MagicMirror#4212 · 2 comments ·
-
bug ready (coming with next release)
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MagicMirrorOrg/MagicMirror#4199 · 8 comments ·
-
bug ready (coming with next release)
MagicMirrorOrg/MagicMirror#4264 · 1 comment · 1 assignee ·
-
enhancement ready (coming with next release)
Difficulty 3/5 1-2 days Newbie friendliness 70/100
MagicMirrorOrg/MagicMirror#4255 · 7 comments ·
-
bug ready (coming with next release)
MagicMirrorOrg/MagicMirror#4253 · 1 comment · 1 assignee ·
All issues in MagicMirrorOrg/MagicMirror
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
Browser Waiting for: Product Owner
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
getsentry/sentry-javascript#24577 · 1 comment ·
-
curation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
amponce/archive-movie-browser#186 ·
-
light
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
aemdemos/patients-stryker#253 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
clerk/javascript#9852 ·