mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
Ignore rrule errors
This commit is contained in:
parent
cec1f12918
commit
78daa65d28
@ -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}/, '');
|
||||
}
|
||||
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