Read the statement by Michael Teeuw here.
MMM-Calendar not seem to load .ics
-
@Dennis-010 the one that throws the error in the somefile.txt, then look it up in the ICS file
-
@sdetweil
Think I found it, will check back tomorrow.BEGIN:VEVENT DTSTAMP:20210413T203456Z UID:E689AEB8C02C4E2CADD8C7D3D303CEAD0 DTSTART;TZID="Amsterdam, Belgrade, Berlin, Brussels, Budapest, Madrid, Paris, Prague, Stockholm":20210415T190000 DTEND;TZID="Amsterdam, Belgrade, Berlin, Brussels, Budapest, Madrid, Paris, Prague, Stockholm":20210415T210000 CLASS:PUBLIC LOCATION:albert heijn SUMMARY:xxx xxxx SEQUENCE:10 RRULE:FREQ=DAILY;UNTIL=20210418T170000Z EXDATE;TZID="Amsterdam, Belgrade, Berlin, Brussels, Budapest, Madrid, Paris, Prague, Stockholm":20210417T190000 EXDATE;TZID="Amsterdam, Belgrade, Berlin, Brussels, Budapest, Madrid, Paris, Prague, Stockholm":20210416T190000 EXDATE;TZID="Amsterdam, Belgrade, Berlin, Brussels, Budapest, Madrid, Paris, Prague, Stockholm":20210415T190000 BEGIN:VALARM ACTION:DISPLAY TRIGGER;RELATED=START:-PT15M END:VALARM END:VEVENT
{"type":"VEVENT","params":[],"uid":"E689AEB8C02C4E2CADD8C7D3D303CEAD0","start":"2021-04-15T17:00:00.000Z","datetype":"date-time","end":"2021-04-15T19:00:00.000Z","a94d8d2a-3> [24.10.2023 00:16.22.001] [DEBUG] start: Thu Apr 15 2021 19:00:00 GMT+0200 (Midden-Europese zomertijd) [24.10.2023 00:16.22.001] [DEBUG] end:: Thu Apr 15 2021 21:00:00 GMT+0200 (Midden-Europese zomertijd) [24.10.2023 00:16.22.002] [DEBUG] duration: 7200000 [24.10.2023 00:16.22.002] [DEBUG] title: xxx xxxx [24.10.2023 00:16.22.002] [DEBUG] Search for recurring events between: Tue Oct 24 2023 00:16:22 GMT+0200 (Midden-Europese zomertijd) and Tue Oct 22 2024 23:59:59 GMT+0200 (M> [24.10.2023 00:16.22.051] [DEBUG] Title: xxx xxxx, with dates: [null,null,null,null] [24.10.2023 00:16.22.051] [DEBUG] event.recurrences: [object Object] [24.10.2023 00:16.22.055] [ERROR] Calendar Error. Could not fetch calendar: https://url/ical/url/Calendar.ics RangeError: Invalid time value at Date.toISOString (<anonymous>) at /home/dennis/MagicMirror/modules/default/calendar/calendarfetcherutils.js:312:28 at Array.forEach (<anonymous>) at Object.filterEvents (/home/dennis/MagicMirror/modules/default/calendar/calendarfetcherutils.js:140:24) at /home/dennis/MagicMirror/modules/default/calendar/calendarfetcher.js:72:36 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
-
@Dennis-010 awesome, will need you to run it again with one debugging change
in calendarfetchutils.js
change thisLog.debug(`event.recurrences: ${event.recurrences}`);
to this
Log.debug("event.recurrences:" +JSON.stringify(event.recurrences));
but I really think its THIS
DTSTART;TZID="Amsterdam, Belgrade, Berlin, Brussels, Budapest, Madrid, Paris, Prague, Stockholm":20210415T190000 DTEND;TZID="Amsterdam, Belgrade, Berlin, Brussels, Budapest, Madrid, Paris, Prague, Stockholm":20210415T210000 the until is outside the event window start/end (04/15, this is 04/18) RRULE:FREQ=DAILY;UNTIL=20210418T170000Z
AND the event is in the past 2021
but the code tried to find recurrences THIS yearTue Oct 24 2023 00:16:22 GMT+0200 (Midden-Europese zomertijd) and Tue Oct 22 2024 23:59:59 GMT+0200 (M> [24.10.2023 00:16.22.051] [DEBUG] Title: xxx xxxx, with dates: [null,null,null,null] <----- and returned junk.. those are bad dates.
-
@Dennis-010 try this
cd ~/MagicMirror/modules/default/calendar cp calendarfetcherutils.js utils.js nano calendarfetcherutils.js
insert this line
futureLocal = futureMoment.toDate(); // future } if(moment(endDate)>=moment(pastLocal)){ //<--- this line (approx line 283) Log.debug(`Search for recurring events between: ${pastLocal} and ${futureLocal}`); const dates = rule.between(pastLocal, futureLocal, true, limitFunction);
and this line
i description: description }); } } // < ----- this line (approx line 454) }
this adds a check if the event end is after the calculated start (for include past events thats a year back) , then process the event, else skip it…
let me know
-
@sdetweil
This did the trick, thank you very much.You are a genius!!
-
@Dennis-010 said in MMM-Calendar not seem to load .ics:
You are a genius!!
well, i don’t know about that… I’ve just spent the last few years fixing bugs in there