-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
fix calendar not showing events with the same name and start date but different calendar url #3166
Conversation
…t different calendar url
Thx for the PR, unfortunately your test is failing. Can you have a look? |
I'm not that deep into the code. The better solution would probably be to compare some event ID. But for this use case the change should fix it |
please run |
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## develop #3166 +/- ##
===========================================
+ Coverage 25.51% 26.23% +0.71%
===========================================
Files 53 53
Lines 11501 11502 +1
===========================================
+ Hits 2935 3018 +83
+ Misses 8566 8484 -82
|
modules/default/calendar/calendar.js
Outdated
@@ -559,7 +559,7 @@ Module.register("calendar", { | |||
let maxPastDaysCompare = now - this.maximumPastDaysForUrl(calendarUrl) * ONE_DAY; | |||
for (const e in calendar) { | |||
const event = JSON.parse(JSON.stringify(calendar[e])); // clone object | |||
|
|||
event.url = calendarUrl; |
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.
why move this?
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 is because otherwise the url isn't set yet for the comparison in listContainsEvent() in line 574.
But a better solution would be to compare events based on their UID. But for this I'd need more code (and javascript :D) knowledge
Sorry for the long delay until I commented more. Now I had the time to look at the code myself and I'd rather add a new config option |
Updating regarding PR MagicMirrorOrg/MagicMirror#3166
* Updating calendar documentation Updating regarding PR MagicMirrorOrg/MagicMirror#3166 * Update calendar.md fix typo * Update calendar.md fix description
I fixed the calendar module, which did not show calendar entries from different calendars that share the same name and start date.
My use case: We have each office days documented in each an own calendar. If both "Office" Calendar entries start at the same date just one was shown
Google Calendar (each Office event in an own calendar)
Before
After