curr.start is not always a date type (depends on ics file). A type check

has been added.
This commit is contained in:
Christoph Hagedorn 2019-06-09 17:46:48 +02:00
parent caf56671dc
commit e694b080be

View File

@ -37,8 +37,10 @@ ical.objectHandlers['END'] = function(val, params, curr, stack){
}
}
rule += ' DTSTART:' + curr.start.toISOString().replace(/[-:]/g, '');
rule = rule.replace(/\.[0-9]{3}/, '');
if( typeof (curr.start) === "date") {
rule += ' DTSTART:' + curr.start.toISOString().replace(/[-:]/g, '');
rule = rule.replace(/\.[0-9]{3}/, '');
}
}
for (var i in curr.exdates) {
rule += ' EXDATE:' + curr.exdates[i].toISOString().replace(/[-:]/g, '');