mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
Merge pull request #1458 from tomwardill/ignore-rrule-errors
Ignore RRULE errors for unparseable elements.
This commit is contained in:
commit
75054fcc70
@ -22,6 +22,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
### Fixed
|
||||
- Allow to parse recurring calendar events where the start date is before 1900
|
||||
- Fixed Polish translation for Single Update Info
|
||||
- Ignore entries with unparseable details in the calendar module
|
||||
|
||||
### Updated
|
||||
- The default calendar setting `showEnd` is changed to `false`.
|
||||
|
@ -171,7 +171,7 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri
|
||||
var geo = event.geo || false;
|
||||
var description = event.description || false;
|
||||
|
||||
if (typeof event.rrule != "undefined" && !isFacebookBirthday) {
|
||||
if (typeof event.rrule != "undefined" && event.rrule != null && !isFacebookBirthday) {
|
||||
var rule = event.rrule;
|
||||
|
||||
// can cause problems with e.g. birthdays before 1900
|
||||
|
@ -44,7 +44,13 @@ ical.objectHandlers['END'] = function(val, params, curr, stack){
|
||||
rule += ' EXDATE:' + curr.exdates[i].toISOString().replace(/[-:]/g, '');
|
||||
rule = rule.replace(/\.[0-9]{3}/, '');
|
||||
}
|
||||
curr.rrule = rrulestr(rule);
|
||||
try {
|
||||
curr.rrule = rrulestr(rule);
|
||||
}
|
||||
catch(err) {
|
||||
console.log("Unrecognised element in calendar feed, ignoring: " + rule);
|
||||
curr.rrule = null;
|
||||
}
|
||||
}
|
||||
return originalEnd.call(this, val, params, curr, stack);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user