From e694b080be444ab5eca9978c4d57c6d0a1497be6 Mon Sep 17 00:00:00 2001 From: Christoph Hagedorn Date: Sun, 9 Jun 2019 17:46:48 +0200 Subject: [PATCH 1/4] curr.start is not always a date type (depends on ics file). A type check has been added. --- modules/default/calendar/vendor/ical.js/node-ical.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/default/calendar/vendor/ical.js/node-ical.js b/modules/default/calendar/vendor/ical.js/node-ical.js index e42ce895..4da1fc4f 100644 --- a/modules/default/calendar/vendor/ical.js/node-ical.js +++ b/modules/default/calendar/vendor/ical.js/node-ical.js @@ -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, ''); From ec65e66c58d94f2bf2aaae33b3c2a70187168cad Mon Sep 17 00:00:00 2001 From: Christoph Hagedorn Date: Tue, 11 Jun 2019 22:43:48 +0200 Subject: [PATCH 2/4] added fixed issue in changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a375192..545b7a52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - 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 From 964504b9c365c1afd7b296a7a142d0ae643b4ed5 Mon Sep 17 00:00:00 2001 From: Christoph Hagedorn Date: Tue, 11 Jun 2019 23:24:03 +0200 Subject: [PATCH 3/4] curr.exdates[i] might not be a date, so toISOString() may fail too --- modules/default/calendar/vendor/ical.js/node-ical.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/default/calendar/vendor/ical.js/node-ical.js b/modules/default/calendar/vendor/ical.js/node-ical.js index 4da1fc4f..1d295f8c 100644 --- a/modules/default/calendar/vendor/ical.js/node-ical.js +++ b/modules/default/calendar/vendor/ical.js/node-ical.js @@ -43,8 +43,10 @@ ical.objectHandlers['END'] = function(val, params, curr, stack){ } } for (var i in curr.exdates) { - rule += ' EXDATE:' + curr.exdates[i].toISOString().replace(/[-:]/g, ''); - rule = rule.replace(/\.[0-9]{3}/, ''); + 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); From 499e99cfc520d66fd2faebba256d312fb32f5465 Mon Sep 17 00:00:00 2001 From: Christoph Hagedorn Date: Thu, 13 Jun 2019 18:11:41 +0200 Subject: [PATCH 4/4] fixed url --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 545b7a52..e3726cfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - 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 +- 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