Merge pull request #1699 from Hg347/calendar-1696

fixed calendar, issue 1696, ics file start date is not date type
This commit is contained in:
Michael Teeuw 2019-06-13 20:15:53 +02:00 committed by GitHub
commit cf2723aafb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -33,6 +33,7 @@ Added UK Met Office Datapoint feed as a provider in the default weather module.
- Only update clock once per minute when seconds aren't shown
### Fixed
- fixed issue [#1696](https://github.com/MichMich/MagicMirror/issues/1696), some ical files start date to not parse to date type
- Allowance HTML5 autoplay-policy (policy is changed from Chrome 66 updates)
- Handle SIGTERM messages
- Fixes sliceMultiDayEvents so it respects maximumNumberOfDays

View File

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