Read the statement by Michael Teeuw here.
MMM-CX3A - Transform not working?
-
@MMRIZE (tagged as author)
I have 4 transforms attempting to work at the same time, the last one “busy” doesn’t work - can someone explain why?
eventTransformer: (ev) => { if (ev.title.search("🏠") > -1) { ev.title = ev.title.replace("🏠 Personal Commitment","Private (Brendan)"); ev.color = 'yellow'; } if (ev.title.search("✈ Flight") > -1) { ev.title = ev.title.replace("✈ Flight","Private (Brendan)"); ev.color = 'yellow'; } if (ev.title.search("🚌️") > -1) { ev.title = ev.title.replace("🚌️ Transit","Private (Brendan)"); ev.color = 'yellow'; } if (ev.title.search("busy️") > -1) { ev.title = ev.title.replace("busy","Private (Mom)"); ev.color = 'yellow'; } return ev }, -
@BKeyport is it lower case busy?
-
@BKeyport
Font seems weird. (“y” of “busy”)

-
@MMRIZE good catch, that’s what it was… Cut and paste solved it. I really hate that my calendar merger application uses weird junk like that.
-
@MMRIZE interesting, it doesn’t appear like that for me
-
@sdetweil it looks normal for me, too - however, a cut and paste into both fields from the original text does fix it, so, whatever.
-
@BKeyport
Anyway, how about this code for those who need many transforming like you?eventTransformer: (event) => { const replaceMap = { 'original': 'Replaced', 'text': 'string', 'foo': 'bar', 'baz': 'qux', } Object.keys(replaceMap).forEach((key) => { const regex = new RegExp(key, 'gi') event.title = event.title.replace(regex, (token) => { event.color = 'red' return replaceMap[ key ] }) }) return event }
-
@MMRIZE That looks interesting… Most of my transforming is yanking out the emoji, though - because electron does partial display at best, and I so hate the boxed X showing up everywhere.
-
@BKeyport
You may need to install emoji fonts
Or you can parse out non-ASCII characters with regular expressions. -
@MMRIZE Interesting. How would one install the Emoji fonts? I’d rather have the prettyness than all text.
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login