mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
Allow to parse recurring calendar events where the start date is before 1970
Some birthday calendar events have a start date before 1970.
This commit is contained in:
parent
d4fe01f9b9
commit
39619d5277
@ -173,6 +173,14 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri
|
||||
|
||||
if (typeof event.rrule != "undefined" && !isFacebookBirthday) {
|
||||
var rule = event.rrule;
|
||||
|
||||
// can cause problems with birthdays before 1970
|
||||
if(rule.origOptions && rule.origOptions.dtstart && rule.origOptions.dtstart.getFullYear() < 1970 ||
|
||||
rule.options && rule.options.dtstart && rule.options.dtstart.getFullYear() < 1970){
|
||||
rule.origOptions.dtstart.setYear(1970);
|
||||
rule.options.dtstart.setYear(1970);
|
||||
}
|
||||
|
||||
var dates = rule.between(today, future, true, limitFunction);
|
||||
|
||||
for (var d in dates) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user