Simple Lovelace Date card

Hello there

Besides being quite embarrased, I must admit I can’t stop laughing at myself…

I can’t figure out how to make a simple Date card. What I’m after is nothing more advanced than this :

Date card

I need it to replace the topleft third button card, after I found the nice HTC Clock card. Thanks to @ibBogdan

Thanks for any help !

/Michael

If you have mushroom cards installed, you can create a mushroom template card and add the code below
2022-04-18 08_16_56-System – Home Assistant – Google Chrome

type: custom:mushroom-template-card
primary: >-
  {% set danishWeekdays = ["MANDAG",
  "TIRSDAG","ONSDAG","TORSDAG","FREDAG","LØRDAG","SØNDAG"] %}

  {{ danishWeekdays[now().weekday()] }}
secondary: '{{ now().strftime(''%d/%m/%Y'') }}'
multiline_secondary: false
1 Like

Thank you chewbaccadk

I didn’t know about this card, but it looks very promising. I can see I need to update HA to use this, as I’m a few versions behind on 2021.10.6.
This is always troublesome, so I’ll wait till the coming weekend. I can see from the above though that this will work, and is excatly what I’m looking for.

Mange tak Sarah !

/Michael

1 Like

Hi Michael

With this code, you can create your date card without mushroom:

type: markdown
content: >-
  {% set danishWeekdays = ["MANDAG",
  "TIRSDAG","ONSDAG","TORSDAG","FREDAG","LØRDAG","SØNDAG"] %} 

  ## {{danishWeekdays[now().weekday()] }}

  {{ now().strftime('%d/%m/%Y') }}

Velbekomme :wink:

//Sarah

1 Like

Hello chewbaccadk (Sarah)

Thanks for the new code. I have updated my HA this afternoon, and installed Mushroom. Your first code works flawlessly.

  • Now I’m looking forward to a long evening of fixing all the things that are broken after the upgrade… LOL.

Thanks again Sarah !