mirror of
https://github.com/MichMich/MagicMirror.git
synced 2026-06-09 03:34:51 +00:00
fix(calendar): make showEnd behavior more consistent across time formats (#4059)
Closes #4053 This started as a small fix. After feedback and more debugging, I found more issues and inconsistencies and went a bit down the rabbit hole. The PR is bigger now, but I think the result is better: behavior is more predictable, and the output is more consistent. ## Changes - Multi-day full-day events now show an end date in `relative` and `dateheaders` when `showEnd` is enabled. - With `absolute` + `nextDaysRelative`, full-day events now keep the end date when the start is replaced by TODAY/TOMORROW/etc. - Timed events in `absolute` now also respect `showEndsOnlyWithDuration`. - Tests were expanded and refactored to cover more showEnd cases and keep the setup easier to maintain. - I also refactored parts of the calendar time rendering to reduce duplicate logic. ## Before <img width="1816" height="756" alt="before" src="https://github.com/user-attachments/assets/ebec81fd-0c4a-4f9f-bbe3-e2b32ef6756e" /> ## After <img width="1816" height="756" alt="after" src="https://github.com/user-attachments/assets/8a2c652d-dddc-4f6b-9074-fbef3411f9ed" />
This commit is contained in:
committed by
GitHub
parent
d072345775
commit
e1c44a86bb
18
tests/mocks/event_with_time_over_multiple_days_yearly.ics
Normal file
18
tests/mocks/event_with_time_over_multiple_days_yearly.ics
Normal file
@@ -0,0 +1,18 @@
|
||||
BEGIN:VCALENDAR
|
||||
VERSION:2.0
|
||||
PRODID:-//MagicMirror Test//timed-multiday-yearly//EN
|
||||
CALSCALE:GREGORIAN
|
||||
BEGIN:VEVENT
|
||||
DTSTART:20241026T010000Z
|
||||
DTEND:20241026T110000Z
|
||||
DTSTAMP:20241024T153358Z
|
||||
UID:4maud6s79m41a99pj2g7j5km0a@google.com
|
||||
CREATED:20241024T153313Z
|
||||
LAST-MODIFIED:20241024T153330Z
|
||||
SEQUENCE:0
|
||||
STATUS:CONFIRMED
|
||||
RRULE:FREQ=YEARLY
|
||||
SUMMARY:Sleep over at Bobs
|
||||
TRANSP:OPAQUE
|
||||
END:VEVENT
|
||||
END:VCALENDAR
|
||||
18
tests/mocks/event_with_time_same_day_yearly.ics
Normal file
18
tests/mocks/event_with_time_same_day_yearly.ics
Normal file
@@ -0,0 +1,18 @@
|
||||
BEGIN:VCALENDAR
|
||||
VERSION:2.0
|
||||
PRODID:-//MagicMirror Test//timed-same-day-yearly//EN
|
||||
CALSCALE:GREGORIAN
|
||||
BEGIN:VEVENT
|
||||
DTSTART:20241025T200000
|
||||
DTEND:20241025T220000
|
||||
DTSTAMP:20241024T153358Z
|
||||
UID:timed-same-day-yearly@magicmirror
|
||||
CREATED:20241024T153313Z
|
||||
LAST-MODIFIED:20241024T153330Z
|
||||
SEQUENCE:0
|
||||
STATUS:CONFIRMED
|
||||
RRULE:FREQ=YEARLY
|
||||
SUMMARY:Same day timed event
|
||||
TRANSP:OPAQUE
|
||||
END:VEVENT
|
||||
END:VCALENDAR
|
||||
Reference in New Issue
Block a user