-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix(calendar): show end date for multi-day full-day events in all timeFormats #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
Draft
KristjanESPERANTO
wants to merge
4
commits into
MagicMirrorOrg:develop
Choose a base branch
from
KristjanESPERANTO:fix/calendar4053
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 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 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.