fix(calendar): show end date for multi-day full-day events in all timeFormats#4059
fix(calendar): show end date for multi-day full-day events in all timeFormats#4059KristjanESPERANTO wants to merge 4 commits intoMagicMirrorOrg:developfrom
Conversation
…eFormats showEnd: true now works for full-day events spanning multiple days in 'relative' and 'dateheaders' mode, not just 'absolute'. Also, when nextDaysRelative replaces the start with 'Tomorrow' etc., the end date is appended (e.g. 'Tomorrow - 17th Mar'). showEndsOnlyWithDuration suppresses the end date as expected. Closes MagicMirrorOrg#4053
|
Hi @KristjanESPERANTO , thank you for your interest and work. I verified your patch and confirmed it works perfectly with fullday event. However, this doesn't show the end for the 'Multiday events with time(full day not checked)', e.g. from 10:00AM 30.03.2026 to 11:00AM 02.04.2026 . |
Add electron test coverage for timed (non-full-day) multi-day events with showEnd enabled in `relative` and `dateheaders` modes. Use a yearly recurring mock ICS so tests stay stable over time and avoid "no upcoming events" failures as dates move on.
| Log.info("[calendar] not full day but within getRelative size"); | ||
| // If event is within getRelative hours, display 'in xxx' time format or moment.fromNow() | ||
| timeWrapper.innerHTML = `${CalendarUtils.capFirst(eventStartDateMoment.fromNow())}`; | ||
| } else if (this.config.showEnd && (!this.config.showEndsOnlyWithDuration || event.startDate !== event.endDate)) { |
There was a problem hiding this comment.
Thank you @KristjanESPERANTO for the quick response! And additional functionality for dateEndFormat as well.
This works perfectly with the corner case which is the multiple day with specific time values.
Luckily or not, I found this line affects the existing behavior. The single day event is showing the end date even though the start date and the end date are same.
I am not sure if this is expected behavior but this line seems like it is supposed to show the end date when the startDate and endDate are different. From my debugging, the event.startDate !== event.endDate returns always true even if the dates are same. (Please see the reds above)
For draft, I checked below code fits this case. I'd appreciate it if you check this once again.
} else if (this.config.showEnd && (!this.config.showEndsOnlyWithDuration && !eventStartDateMoment.isSame(eventEndDateMoment, "d"))) {
There was a problem hiding this comment.
I see your point. I need to think this through more deeply.

Closes #4053
What was broken
showEnd: truehad no effect for multi-day full-day events unlesstimeFormatwas"absolute"(withoutnextDaysRelative). In"relative"and"dateheaders"mode the end date was simply never rendered.What I changed
dateheaders: Full-day events always gotcolSpan="2"on the title cell. Now, when the event spans multiple days andshowEndis set, a separate time cell withstartDate-endDateis created instead. Single-day events andshowEndsOnlyWithDuration: truekeep the old behaviour.relative: Added the same end-date append that already existed for timed events - after the TODAY/TOMORROW/etc. label the end date is appended for multi-day full-day events.absolute+nextDaysRelative: The start date gets replaced by a relative label, but the end date was never appended afterwards. Fixed that. I introduced a smallrelativeLabelflag to make sure the end date is only added when a relative label actually replaced the start - otherwise events outside the relative range would have shown the end date twice.Before
After