Skip to content

Commit

Permalink
feat: add ticket emoji and colorization (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgokcin authored Sep 23, 2024
1 parent 5ff0f33 commit 2102620
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Code.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const emojiMap = {
'payment': '💸',
'start date': '🏁',
'gas and electricity': '🔌',
'ticket': '🎫'
};

function ColorEvents() {
Expand Down Expand Up @@ -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
Expand All @@ -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)) {
Expand Down

0 comments on commit 2102620

Please sign in to comment.