[calendar] Fix sliced multi-day sub-events starting at 23:59 instead of next day 00:00#4207
Closed
ago1776 wants to merge 1 commit into
Closed
Conversation
…of next day 00:00
With `sliceMultiDayEvents: true`, every slice after the first was assigned a
startDate of `midnight` = `.endOf("day")` (23:59:59.999) instead of the next
day's 00:00, so subsequent slices rendered as starting at "23:59".
Use the start of the day for the next slice's startDate.
Adds an e2e regression test asserting no sliced sub-event time cell shows
"23:59" (24h format).
Fixes MagicMirrorOrg#4206
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author
Collaborator
|
Just a friendly hint: You could have adjusted this PR here. That would have caused less noise. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4206
Problem
With
sliceMultiDayEvents: true, a multi-day event is split into per-day slices(1/n),(2/n), … Every slice after the first was displayed as starting at 23:59 instead of the next day's 00:00.Cause
In
defaultmodules/calendar/calendar.js, the slicing loop advances the day boundary with:midnightis.endOf("day")(23:59:59.999) but is assigned as the following slice'sstartDate, so each subsequent slice starts at 23:59:59.999 of the previous day rather than 00:00 of its own day.Fix
Use the start of the day for the next slice's start:
Test
Adds an e2e regression test (
sliceMultiDayEvents sub-event start time) that reuses the existing slice mock with a 24htimeFormatand asserts that no sliced sub-event time cell contains23:59. It fails on the previous behaviour and passes with the fix.Note: I could not run the full Electron e2e suite locally (resource-constrained hardware running production services); the fix logic was verified with a standalone reproduction and the test follows the existing
sliceMultiDayEventspatterns. Happy to adjust based on CI.