From 210262074859f8725803884846b8a5f685c3a865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?deniz=20g=C3=B6k=C3=A7in?= <33603535+dgokcin@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:13:29 +0200 Subject: [PATCH] feat: add ticket emoji and colorization (#8) --- Code.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Code.js b/Code.js index 3cd3892..f531f03 100644 --- a/Code.js +++ b/Code.js @@ -25,6 +25,7 @@ const emojiMap = { 'payment': '💸', 'start date': '🏁', 'gas and electricity': '🔌', + 'ticket': '🎫' }; function ColorEvents() { @@ -100,7 +101,8 @@ function ColorEvents() { "gas and electricity": /\bgas and electricity\b/i, "tamir": /\btamir\b/i, "repair": /\brepair\b/i, - "payment": /\bpayment\b/i + "payment": /\bpayment\b/i, + "ticket": /\bticket\b/i }; // Check the updated title for colorization using regex @@ -119,7 +121,7 @@ function ColorEvents() { } else if (regexMap["meeting"].test(lowerTitle) || regexMap["catch-up"].test(lowerTitle) || regexMap["video call"].test(lowerTitle) || regexMap["call"].test(lowerTitle) || regexMap["ara"].test(lowerTitle)) { color = CalendarApp.EventColor.MAUVE; Logger.log("Title: " + title + " - Color to print: MAUVE"); - } else if (regexMap["sosyal aktivite"].test(lowerTitle)) { + } else if (regexMap["sosyal aktivite"].test(lowerTitle) || regexMap["ticket"].test(lowerTitle)) { color = CalendarApp.EventColor.PALE_GREEN; Logger.log("Title: " + title + " - Color to print: PALE_GREEN"); } else if (regexMap["paris 2024"].test(lowerTitle)) {