MMRIZE / MMM-CalendarExt3

MagicMirror calendar view module
MIT License
58 stars 22 forks source link

eventTransformer not able to set symbol #52

Closed mafraqs closed 1 year ago

mafraqs commented 1 year ago

When trying to set a new symbol for certain events using the event transformer an error occours.

config:

eventTransformer: (ev) => {
    if (ev.title.search('summer') > -1) ev.symbol = "umbrella-beach"
    return ev
},

I have tried different variations to set the new symbol: ev.symbol = "umbrella-beach" ev.symbol = "[umbrella-beach]" ev.symbol = "['umbrella-beach']"

error in console:

Uncaught (in promise) TypeError: event.symbol.join is not a function
    at Class.draw (MMM-CalendarExt3.js:450:44)
    at Class.getDom (MMM-CalendarExt3.js:153:16)
    at main.js:113:35
    at new Promise (<anonymous>)
    at updateDom (main.js:111:10)
    at Object.updateDom (main.js:552:4)
    at Class.updateDom (module.js:358:6)
    at MMM-CalendarExt3.js:102:14
eouia commented 1 year ago

Try this;

ev.symbol = ['umbrella-beach']
mafraqs commented 1 year ago

Thanks. 😄 Please don't ask me why I tried setting an array using quotation marks.