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 !

Hi Sarah (chewbaccadk) and Mik (MichaelJ2600),
Do you know how to make a Time card as well, which can possibly be integrated into this date card. A clock would be great!

Thanks
Adi Ma

type: custom:digital-clock
dateFormat:
  weekday: long
  day: 2-digit
  month: short
  year: numeric
timeFormat:
  hour: 2-digit
  minute: 2-digit
  second: 2-digit

https://github.com/wassy92x/lovelace-digital-clock

Simple and easy, and dymanicly updates the time.

Hi Michael,

can I ask where you got the integrated time and weather card?

Hello Woody1

Certainly, it’s this one : GitHub - iamBiB/lovelace-htc-flipclock-weather: HTC Flipclock with Weather card

Unfortunately it doesn’t get updated anymore, and you will face som challenges with the sizing of the card in newer versions of HA, but at great card !

/MichaelJ