Petro31 / easy-time-jinja

Easy Time calculations for Home Assistant templates
MIT License
68 stars 25 forks source link

weekday function - removed positive restriction #35

Open koostamas opened 1 month ago

koostamas commented 1 month ago

Removed the positive restriction for the weekday parameter, because the algorithm is still correct, and it would make the speak_the_days() function return today's name for most negative indexes (i <= -2).

Petro31 commented 1 month ago

What will this get us? There's other macros that give you days that are in the past. A negative index does not make sense because there is no day in the list 1,2,3,4,5,6,7 that is negative.

koostamas commented 1 month ago

Okay, I understand you. In that case, we can just fix it in the speak_the_days() function, if you like that better: https://github.com/Petro31/easy-time-jinja/pull/36