eouia / MMM-CalendarExt

Calendar views for MagicMirror
MIT License
57 stars 18 forks source link

How to have symbolPattern see upper and lower case? #26

Closed cshaffer1 closed 6 years ago

cshaffer1 commented 6 years ago

My issue is just for saving time typing. I'm using the symbolPattern for different events in the calendar and works perfect. Only question: is there a way to have it match upper and lowercase. See my code below: symbolPattern: [["Softball", "baseball@em"], ["Soccer", "soccer@em"], ["Basketball", "basketball@em"], ["School", "straight_ruler@em"], ["Birthday", "birthday@em"], ["Gymnastics", "woman-cartwheeling@em"], ["sewing", "scissors@em"], ["envirothon", "turtle@em"]],

I have to use "sewing" as lowercase because it is in the calendar that way but if it gets added as "Sewing" the symbol won't show. Is there a way to cover upper and lower without having to type all of them 2 times: ["sewing", "scissors@em"], ["Sewing", "scissors@em"], Thank you again for your help. This calendar is so amazing and work so well.

eouia commented 6 years ago

@cshaffer1 I'm not with my real device currently, so I should have solved this by my brain itself. :D I think this could be work.

[/sewing/i, "scissors@em"],

It symbolPattern uses regular expression, thus this syntax will work. (I hope)

cshaffer1 commented 6 years ago

Thanks for the quick response. I tried that it didn't work. I messed with it and got it to work like this: ["/sewing/i", "scissors@em"], Just forgot the quotes:) Thank you again for the help and a great mod to the MagicMirror.