I’m trying to create a Markdown Card that changes its content (some fixed text) based on the day of the week
So, something like
if Monday:
content = "This is the text for Monday"
if Tuesday:
content = "This is the text for Tuesday"
I guess I should use the time condition, probably. What I don’t want to do is to create one card and one trigger for each day
Any ideas?
tom_l
2
type: markdown
content: >
{% if now().weekday() == 0 %}
Ugh Monday 🌧️
{% elif now().weekday() == 1 %}
Taco Tuesday 🌮
{% elif now().weekday() == 2 %}
Hump Day 🐪
{% elif now().weekday() == 3 %}
Thorsday ⚡
{% elif now().weekday() == 4 %}
Poets Day 🕓
{% elif now().weekday() == 5 %}
Catturday 🐈
{% elif now().weekday() == 6 %}
Funday 🎉
{% endif %}
123
(Taras)
3
{% set content =
['Monday message',
'Tuesday message',
'Wednesday message',
'Thursday message',
'Friday message',
'Saturday message',
'Sunday message'][now().weekday()] %}
{{ content }}
2 Likes