Novell1
(Novell1)
May 26, 2024, 9:33am
1
Hello everyone, can someone help me how to change the day of the week from Sun to Saturday (German) in bold?
Here is the first line in the main menu, and the code:
Today is the {{ as_timestamp(now()) | timestamp_custom(β%a.%d.%m.%Yβ) }}
Thank you very much!!!
Novell1
nickrout
(Nick Rout)
May 26, 2024, 9:44am
2
Well 26 May is Sunday so why do you want it to say Saturday?
I will print only the day name with ** ** and them the rest of the date without the day name.
** {{ as_timestamp(now()) | timestamp_custom(β%aβ) }} ** {{ as_timestamp(now()) | timestamp_custom(β%d.%m.%Yβ)}}
I suppose this should be work with your custom timestamp
Novell1
(Novell1)
May 27, 2024, 7:14pm
4
Hello d13g0m0nt3s
thanks for your tip
! But I get an error with your line (64).
Heute ist der ** {{ as_timestamp(now()) | timestamp_custom(β%aβ) }} ** {{ as_timestamp(now()) | timestamp_custom(β%d.%m.%Yβ)}}
best regards
novell1
Change β for β
** Heute ist der ** ** {{ as_timestamp(now()) | timestamp_custom("%a") }} ** {{ as_timestamp(now()) | timestamp_custom("%d.%m.%Y")}}
Edwin_D
(Edwin D.)
May 27, 2024, 7:27pm
6
**Heute ist der** {{ as_timestamp(now()) | timestamp_custom('**%a**.%d.%m.%Y')}}```
1 Like
Thou i think he want a Capital (a), (A), for Monday
arkixana
(Arkixana)
May 27, 2024, 7:42pm
8
Hi, you can try this, feel free to change the days to whatever you want:
{% set wd = ["Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag"] %}
{{ wd[now().weekday()] + now().strftime(' %d.%m.%Y ')}}
Edwin_D
(Edwin D.)
May 27, 2024, 7:49pm
9
It seems I missed the language bit. If you do not mind installing things, thereβs also this:
Hello community!
As you may know, 2023.4 offers a new global template macro option in Home Assistant.
How does this benefit you? The introduction of this feature allows me to easily share all the templates Iβve helped you create over the years in a single easy-to-use template library! All in your native language!
Introducingβ¦
Easy Time Jinja
A 1-stop-shop for easy time calculations.
Get it from HACS!
These templates are now available in HACS, with a caveat. In order to see templatβ¦
Novell1
(Novell1)
June 1, 2024, 10:07am
10
Hello Arkixana, thanks a lot! Now it is working!!!
Heute ist der {% set wd = [βMontag β, βDienstag β, βMittwoch β, βDonnerstag β, βFreitag β, βSamstag β, βSonntag β] %}
{{ wd[now().weekday()] + now().strftime(β %d.%m.%Y ')}}
Best regards, and have a nice weekend!!!
Novell1
1 Like