-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix(calendar): make showEnd behavior more consistent across time formats #4059
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
khassel
merged 13 commits into
MagicMirrorOrg:develop
from
KristjanESPERANTO:fix/calendar4053
Mar 17, 2026
Merged
Changes from 3 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
42f8239
fix(calendar): show end date for multi-day full-day events in all tim…
KristjanESPERANTO 7c0cd38
fix(calendar): apply showEnd to timed events in relative/dateheaders
KristjanESPERANTO 3203397
test(calendar): cover timed multi-day showEnd in relative/dateheaders
KristjanESPERANTO d1d43c2
fix(calendar): use time-only format for same-day timed event ends
KristjanESPERANTO c5cb848
fix(calendar): improve timed showEnd formatting across modes
KristjanESPERANTO 27e410e
test(calendar): add timed showEnd regression coverage
KristjanESPERANTO c30813a
fix(calendar): prevent duplicate start time with localized dateFormat…
KristjanESPERANTO c6fb2d9
fix(calendar): respect hideTime for relative showEnd output
KristjanESPERANTO 8c265e1
test(calendar): refactor showEnd specs to table-driven cases
KristjanESPERANTO a1e2d34
refactor(calendar): extract time rendering helpers
KristjanESPERANTO 4e1683f
test(calendar): centralize showEnd fixtures without wrapper files
KristjanESPERANTO e4acbc0
test(calendar): wait for first event time cell before reading text
KristjanESPERANTO 0905eb4
fix(calendar): respect showEndsOnlyWithDuration in absolute timed end
KristjanESPERANTO File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
33 changes: 33 additions & 0 deletions
33
...ules/calendar/event_with_time_over_multiple_days_non_repeating_display_end_dateheaders.js
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| const config = { | ||
| address: "0.0.0.0", | ||
| ipWhitelist: [], | ||
|
|
||
| timeFormat: 24, | ||
| modules: [ | ||
| { | ||
| module: "calendar", | ||
| position: "bottom_bar", | ||
| config: { | ||
| fade: false, | ||
| urgency: 0, | ||
| dateFormat: "Do.MMM, HH:mm", | ||
| dateEndFormat: "Do.MMM, HH:mm", | ||
| fullDayEventDateFormat: "Do.MMM", | ||
| timeFormat: "dateheaders", | ||
| getRelative: 0, | ||
| showEnd: true, | ||
| calendars: [ | ||
| { | ||
| maximumEntries: 100, | ||
| url: "http://localhost:8080/tests/mocks/event_with_time_over_multiple_days_yearly.ics" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| }; | ||
|
|
||
| /*************** DO NOT EDIT THE LINE BELOW ***************/ | ||
| if (typeof module !== "undefined") { | ||
| module.exports = config; | ||
| } |
33 changes: 33 additions & 0 deletions
33
...modules/calendar/event_with_time_over_multiple_days_non_repeating_display_end_relative.js
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| const config = { | ||
| address: "0.0.0.0", | ||
| ipWhitelist: [], | ||
|
|
||
| timeFormat: 24, | ||
| modules: [ | ||
| { | ||
| module: "calendar", | ||
| position: "bottom_bar", | ||
| config: { | ||
| fade: false, | ||
| urgency: 0, | ||
| dateFormat: "Do.MMM, HH:mm", | ||
| dateEndFormat: "Do.MMM, HH:mm", | ||
| fullDayEventDateFormat: "Do.MMM", | ||
| timeFormat: "relative", | ||
| getRelative: 0, | ||
| showEnd: true, | ||
| calendars: [ | ||
| { | ||
| maximumEntries: 100, | ||
| url: "http://localhost:8080/tests/mocks/event_with_time_over_multiple_days_yearly.ics" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| }; | ||
|
|
||
| /*************** DO NOT EDIT THE LINE BELOW ***************/ | ||
| if (typeof module !== "undefined") { | ||
| module.exports = config; | ||
| } |
31 changes: 31 additions & 0 deletions
31
tests/configs/modules/calendar/fullday_multiday_showend_dateheaders.js
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| let config = { | ||
| address: "0.0.0.0", | ||
| ipWhitelist: [], | ||
|
|
||
| timeFormat: 24, | ||
| modules: [ | ||
| { | ||
| module: "calendar", | ||
| position: "bottom_bar", | ||
| config: { | ||
| fade: false, | ||
| urgency: 0, | ||
| fullDayEventDateFormat: "Do.MMM", | ||
| timeFormat: "dateheaders", | ||
| getRelative: 0, | ||
| showEnd: true, | ||
| calendars: [ | ||
| { | ||
| maximumEntries: 100, | ||
| url: "http://localhost:8080/tests/mocks/fullday_event_over_multiple_days_nonrepeating.ics" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| }; | ||
|
|
||
| /*************** DO NOT EDIT THE LINE BELOW ***************/ | ||
| if (typeof module !== "undefined") { | ||
| module.exports = config; | ||
| } |
32 changes: 32 additions & 0 deletions
32
tests/configs/modules/calendar/fullday_multiday_showend_nextdaysrelative.js
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| let config = { | ||
| address: "0.0.0.0", | ||
| ipWhitelist: [], | ||
|
|
||
| timeFormat: 24, | ||
| modules: [ | ||
| { | ||
| module: "calendar", | ||
| position: "bottom_bar", | ||
| config: { | ||
| fade: false, | ||
| urgency: 0, | ||
| fullDayEventDateFormat: "Do.MMM", | ||
| timeFormat: "absolute", | ||
| getRelative: 0, | ||
| showEnd: true, | ||
| nextDaysRelative: true, | ||
| calendars: [ | ||
| { | ||
| maximumEntries: 100, | ||
| url: "http://localhost:8080/tests/mocks/fullday_event_over_multiple_days_nonrepeating.ics" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| }; | ||
|
|
||
| /*************** DO NOT EDIT THE LINE BELOW ***************/ | ||
| if (typeof module !== "undefined") { | ||
| module.exports = config; | ||
| } |
31 changes: 31 additions & 0 deletions
31
tests/configs/modules/calendar/fullday_multiday_showend_relative.js
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| let config = { | ||
| address: "0.0.0.0", | ||
| ipWhitelist: [], | ||
|
|
||
| timeFormat: 24, | ||
| modules: [ | ||
| { | ||
| module: "calendar", | ||
| position: "bottom_bar", | ||
| config: { | ||
| fade: false, | ||
| urgency: 0, | ||
| fullDayEventDateFormat: "Do.MMM", | ||
| timeFormat: "relative", | ||
| getRelative: 0, | ||
| showEnd: true, | ||
| calendars: [ | ||
| { | ||
| maximumEntries: 100, | ||
| url: "http://localhost:8080/tests/mocks/fullday_event_over_multiple_days_nonrepeating.ics" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| }; | ||
|
|
||
| /*************** DO NOT EDIT THE LINE BELOW ***************/ | ||
| if (typeof module !== "undefined") { | ||
| module.exports = config; | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see your point. I need to think this through more deeply.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kkangshawn Can you have another look 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works PERFECTLY. Thank you so much.
P.S. The new
dateEndFormatdistinguishing timed multiday from timed sameday is absolutely cool!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Thanks for testing! 😃
Now let's wait for a review of another core maintainer.