trallan
(karl)
1
I have a markdown card with a link. I would like to insert the current week number inside the link. Is that possible? Something like this:
type: markdown
content: >-
<ha-icon icon="mdi:open-in-new"></ha-icon> [open](https://www.xxx/{{now().strftime('%W')}} .pdf)
Why don’t you just try it?
123
(Taras)
3
It should work because the Markdown Card supports Jinja2 templates.
However, remove the space after }}
because it will break the URL.
strftime('%W')}} .pdf)
^
|
trallan
(karl)
4
Ah that was why it didnt work! Thanks! Though it results in week 18 when it should be 19.
123
(Taras)
6
You can use this to get the ISO week number.
{{ now().isocalendar().week }}
1 Like