Format Weekday Markdowncard

Hello all,

I have a problem for which I have not found a good solution anywhere:

I have a waste calendar whose next date I display in a markdown card. This works so far quite well, but what I can not manage is that the day of the week is output in German. Currently it always comes in English.

System Setup:
Home Assistant Core in Docker Container on Synology NAS

Here my Code:

type: markdown
content: >-
  Nächster Termin: <b>{{state_attr('calendar.abfallkalender', 'message')}}</b><a
  href=/calendar><ha-icon icon="mdi:chevron-double-right"></ha-icon></a></p>
  Datum: {% set t = state_attr('calendar.abfallkalender', 'start_time') %} {{ t
  | as_timestamp | timestamp_custom ("%A, %d.%m.%Y") }}
title: Abfallkalender

example

Weekday OK: Donnerstag
Weekday NOT OK: Thursday

{%- set days = ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnestag","Freitag", "Samstag"] %}

Does not work :frowning:

Is there a way to manage this in the markdown card without creating sensors & co ?

I would be very grateful for your tips.

BR
M

Does not anyone have an idea ?

Do a replace filter for the output. I’m on a mobile device right now, so I can’t check my work, but ping me if you can’t figure it out. Here’s the example with only “Monday” replaced to “Montag”. Add a |replace filter for each day of the week.


Datum: {% set t = state_attr('calendar.abfallkalender', 'start_time') %} {{ t | as_timestamp | timestamp_custom ("%A, %d.%m.%Y") |replace ("Monday" , "Montag") }}

Hello @modelstudent101,

This is the solution. THANK YOU !

| replace ("Monday" , "Montag") | replace ("Tuesday" , "Dienstag") | replace ("Wednesday" , "Mittwoch") | replace ("Thursday" , "Donnerstag") | replace ("Friday" , "Freitag") | replace ("Saturday" , "Samstag") | replace ("Sunday" , "Sonntag") }}