Read the statement by Michael Teeuw here.
Calendar has stopped working
-
@Jonsar looking at it… no idea yet
-
@Jonsar ok, fun time… MS screws us again
they changed the format of the timezone reporting…lovely
not our code, but the calendar parser we use (that I fixed the last 2 times)
workaround
cd ~/MagicMirror/node_modules/node-ical
nano ical.js , scroll down to line 120
delete the whole line and paste in the new one (cursor has to be on that line to paste it there)change this (line 120 is the code, 119 is the comment)
// If this is the custom timezone from MS Outlook if (tz === 'tzone://Microsoft/Custom' ) {
to this
// If this is the custom timezone from MS Outlook if (tz === 'tzone://Microsoft/Custom' || tz === 'Customized Time Zone' || tz.startsWith('tzone://Microsoft/')) {
also need to fix our code
cd ~/MagicMirror/modules/default/calendar
nano calendarutils.js
change this , line 518
getIanaTZFromMS: function (msTZName) { // Get hash entry
to this
getIanaTZFromMS: function (msTZName) { if(msTZName ==='Customized Time Zone'){ return moment.tz.guess() } // Get hash entry
-
@sdetweil said in Calendar has stopped working:
cd ~/MagicMirror/modules/default/calendar
Thanks for this. It didn’t exactly work. It definitely got further than before but I ended up with this error.
Invalid time value
at Date.toISOString (:null:null)
at /home/pi/MagicMirror/modules/default/calendar/calendarutils.js:314:28
at Array.forEach (:null:null)
at Object.filterEvents (/home/pi/MagicMirror/modules/default/calendar/calendarutils.js:142:24)
at /home/pi/MagicMirror/modules/default/calendar/calendarfetcher.js:74:29
at processTicksAndRejections (node:internal/process/task_queues:96:5) -
@Jonsar can u show me the cal event data in the logs right before the error?
-
@sdetweil said in Calendar has stopped working:
|| tz === ‘Customized Time Zone’
I see there were two place in ical.js
and there is a timezone like this
‘Customized Time Zone 1’
so this will fail
tz === 'Customized Time Zone'
change to this
tz.startsWith('Customized Time Zone')
in all three places … 2 in node ical.j one in caldendarutils.js
-
@sdetweil Thank you, but I can only find 1 place in ical.js. There is one place in calendarutils.js but it is:
if(msTZName === ‘Customized Time Zone’){The whole error I get is:
[19.09.2022 21:46.41.439] [DEBUG] Search for recurring events between: Mon Sep 19 2022 21:46:41 GMT-0400 (Eastern Daylight Time) and Mon Sep 18 2023 23:59:59 GMT-0400 (Eastern Daylight Time)
[19.09.2022 21:46.41.441] [DEBUG] Title: Tentative: XX, with dates: [null,null]
[19.09.2022 21:46.41.442] [DEBUG] event.recurrences: [object Object]
[19.09.2022 21:46.41.449] [ERROR] Calendar Error. Could not fetch calendar: https://outlook.office365.com/owa/calendar/4d70fc7a1bf94d5ab75018902050b8f9@tssg.ca/XXXXXXcalendar.ics RangeError: Invalid time value
at Date.toISOString (:null:null)
at /home/pi/MagicMirror/modules/default/calendar/calendarutils.js:314:28
at Array.forEach (:null:null)
at Object.filterEvents (/home/pi/MagicMirror/modules/default/calendar/calendarutils.js:142:24)
at /home/pi/MagicMirror/modules/default/calendar/calendarfetcher.js:74:29
at processTicksAndRejections (node:internal/process/task_queues:96:5) -
@Jonsar said in Calendar has stopped working:
find 1 place in ical.js. There is one place in calendarutils.js but it is:
if(msTZName === ‘Customized Time Zone’){yes, I said above that there were actually 2… in ical.js
and to make the second look like the 1styes, in calendarutils, 1, which I gave instructions to change
if(msTZName.startsWith(‘Customized Time Zone’){
-
@sdetweil Sorry, I missed the second one in ical.js. It works now! Thanks so much for your help.