Read the statement by Michael Teeuw here.
MMM-CalendarExt3
-
@sdetweil Thank you for the idea. I’ll look into it.
-
Hi,
My MagicMirror has been out of action for a few months now, mainly due to a kitchen renovation, but am looking at getting it back up and running.I’d previously had MMM-CalendarExt3 working with a few different calendars, notably a birthday calendar, where it would show an icon in the cell header.

However since updating the MagicMirror software it no longer seems possible to do. Below is the module extract from config.js, and is what has been previously used. Now upon starting MM with this in place I’m told [ERROR] Your configuration file contains syntax errors :( ‘document’ is not defined.Anyone able to assist with what the issue is and how to resolve it?
{ module: "MMM-CalendarExt3", //https://github.com/MMRIZE/MMM-CalendarExt3 position: "lower_third", //header: "FamCal", config: { mode: "month", useWeather: false, weekIndex: 0, weeksInView: 5, instanceId: "basicCalendar", locale: "en-GB", maxEventLines: 6, firstDayOfWeek: 1, headerWeekDayOptions: {weekday: "short"}, refreshInterval: 60 * 10 * 1000, // 3600000, // every hour // 60 * 10 * 1000, // too frequent refresh. 10 minutes is enough. calendarSet: ["Family Calendar", "UK Holidays", "Birthday",], manipulateDateCell: (cellDom, events) => { if (Array.isArray(events) && events.some(e => e.calendarName === 'Birthday')) { let dateIcon = document.createElement ('span') dateIcon.classList.add ('fa', 'fa-fas', 'fa-fw', 'fa-gift') dateIcon.style.color = 'cornflowerblue' let header = cellDom.querySelector ('.cellHeader') let celldate = header.querySelector ('.cellDate') header.insertBefore (dateIcon, celldate) } }, eventTransformer: (ev) => { if (ev.calendarName === 'Birthday') ev.skip = true else if (ev.title.search("B -") > -1) ev.color = "brown" else if (ev.title.search("C -") > -1) ev.color = "hotpink" else if (ev.title.search("E -") > -1) ev.color = "orange" else if (ev.title.search("I -") > -1) ev.color = "green" else if (ev.title.search("G") > -1) ev.color = "white" else if (ev.title.search("Bday") > -1) ev.title = "" return ev }, eventPayload: (payload) => { for (let ev of payload) { if (ev.fullDayEvent) { let gap = +ev.endDate - +ev.startDate if (gap % (1000 * 60 * 60 * 24) === 0) { ev.startDate = new Date(+ev.startDate).setHours(0, 0, 0, 0) ev.endDate = new Date(+ev.startDate + gap).setMilliseconds(-1) } } } return payload }, }, }, -
@bicolorbore586 can you do
cd ~/MagicMirror npm run config:checkdoes it produce the same error?
also donode -c config/config.jsif it returns and displays nothing, then node did not detect any syntax errors.
edit: I can reproduce this
-
@bicolorbore586 add this to the top of config.js, very first line
var document;
I’ll open a bug report
I opened https://github.com/MagicMirrorOrg/MagicMirror/issues/3990 -
@sdetweil config:check returns the same error
The node one doesn’t produce anythingAdding var document; to the config.js gives parsing error unexpected keyword ‘var’
-
@bicolorbore586 very first line
Right? -
@sdetweil it wasn’t. Does it need to be before let config = { or the fist line after that?
-
@bicolorbore586 very first line of the file, all by itself
Before any comments
