Skip to content

Add Date card - #52994

Open
pcan08 wants to merge 12 commits into
home-assistant:devfrom
pcan08:date-card
Open

Add Date card#52994
pcan08 wants to merge 12 commits into
home-assistant:devfrom
pcan08:date-card

Conversation

@pcan08

@pcan08 pcan08 commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Proposed change

Adds a new "Date" card for showing the current date. It's a sibling to the existing Clock card: same visual style and configuration approach, but for dates.

Screenshots

image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

src/common/datetime/format_date.ts was extended with an optional timeZoneOverride parameter on the formatters the Date card uses, so the card's time zone setting can display a date in a specific zone regardless of the user's profile setting. The parameter is additive and optional, so all existing callers keep working unchanged.

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • I have followed the perfect PR recommendations
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

To help with the load of incoming pull requests:

@MindFreeze

Copy link
Copy Markdown
Member

There is also this #28866

@dcapslock

Copy link
Copy Markdown
Contributor

Adding date to clock card makes more sense in my opinion. You have date options for regular clocks and watches. Rarely do you get a date something, more usually a calendar which HA has already.

@pcan08

pcan08 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

There is also this #28866

Thanks for pointing that out, I missed it

Adding date to clock card makes more sense in my opinion. You have date options for regular clocks and watches. Rarely do you get a date something, more usually a calendar which HA has already.

I agree, since I hadn't seen the date addition to the clock card and found a FR in discussions for a date card, I wanted to give it a try because date was, and is still, missing from the clock card, and I thought this card would be a nice complement to the clock card.

Let's keep this PR for now to see what happens, I also notice that the PR #28866 do not progress for a while

@timmo001 timmo001 added Needs UX Items requiring a review from the Home Assistant design team Noteworthy Marks a PR as noteworthy and should be in the release notes (in case it normally would not appear) labels Jul 6, 2026
# Conflicts:
#	src/panels/lovelace/cards/types.ts
@github-actions github-actions Bot added the Tests: Unit Related to Vitest unit tests label Jul 16, 2026

@timmo001 timmo001 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we have date added to the clock card, we should be consistent if we want to add this too, so the new UiClockDateFormatSelector should be used here too

Still pending UX review whether to add or not

@home-assistant

Copy link
Copy Markdown

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant
home-assistant Bot marked this pull request as draft July 21, 2026 08:23
@pcan08
pcan08 marked this pull request as ready for review July 22, 2026 19:39
@home-assistant
home-assistant Bot requested a review from timmo001 July 22, 2026 19:39
@pcan08

pcan08 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Now we have date added to the clock card, we should be consistent if we want to add this too, so the new UiClockDateFormatSelector should be used here too

Done, I also refactored clock branded components as they are no more related only to the clock card.
Let me know if you're fine with this or not, I can revert the commit and do another PR for this if you prefer.

Please also let me know if the default date format is fine because date formats may vary depending on your locale.

@timmo001
timmo001 removed their request for review July 23, 2026 08:08
@HuisAutomatisering

Copy link
Copy Markdown

Adding date to clock card makes more sense in my opinion. You have date options for regular clocks and watches. Rarely do you get a date something, more usually a calendar which HA has already.

There is no way in Home Assistant to view the current date big on your dashboard, in the same esthetical style as the clock. You can work around it with Picture Elements, but it does all kind of weird layout on different systems while a official clock/date follows the original UI layout for consistency. Also the entity -card who has the biggest view has it's limitations for displaying the date as big and clean as possible, like the clock can. Also tried it with markdown, but it remains a work-around not in style with the quality of the clock card.

@Mariusthvdb

Mariusthvdb commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Now we have date added to the clock card, we should be consistent if we want to add this too, so the new UiClockDateFormatSelector should be used here too

Still pending UX review whether to add or not

would be nice to have a date only option for the clock card, now HA 2026.8 landed the date option (really sweet that is, thanks for that)
add
clock: false

and have best of both worlds ?

@pcan08

pcan08 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

would be nice to have a date only option for the clock card

IMO hiding the clock in the clock card doesn't make sense.
The clock card layout seems built entirely around the clock, moreover you'd have to handle both digital and analog styles which adds complexity.

If the need is to display only the date, I think that a dedicated card makes more sense.

@Mariusthvdb

Copy link
Copy Markdown
Contributor

makes no sense is a bit strong.

also the styles are already there, so no effort either.

and tbh, if you only want a date in a card, just use Markdown.

the clock card seems the ideal card to add that 1 small option.
might give it a better name, like Time card, but that wouldn't even be required I guess.

@HuisAutomatisering

Copy link
Copy Markdown

makes no sense is a bit strong.

also the styles are already there, so no effort either.

and tbh, if you only want a date in a card, just use Markdown.

the clock card seems the ideal card to add that 1 small option. might give it a better name, like Time card, but that wouldn't even be required I guess.

The markdown card uses a different font, appears differently/impossible to match exact card-hight/style beside the clock card in one row. And also does not offer transparancy like te clock card does, which is nice as a big header on top of your cards/ in the corner of your dashboard. Time left and date right in esthetically pleasing match.

@Mariusthvdb

Mariusthvdb commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

makes no sense is a bit strong.
also the styles are already there, so no effort either.
and tbh, if you only want a date in a card, just use Markdown.
the clock card seems the ideal card to add that 1 small option. might give it a better name, like Time card, but that wouldn't even be required I guess.

The markdown card uses a different font, appears differently/impossible to match exact card-hight/style beside the clock card in one row. And also does not offer transparancy like te clock card does, which is nice as a big header on top of your cards/ in the corner of your dashboard. Time left and date right in esthetically pleasing match.

sure, for some styling you'd need 3d party stuff but don't forget markdown can be styled very easily, as
markdown supports html so any styling you'd wish can happen in stock frontend without custom.
but I wont go into that here.

I am all in for the clock card with a date only variant.
its the copying of all of that clock card elements that made me suggest the addition to the clock card.
just keep the code as tight as possible

other than that will keep out of this convo.

@pcan08
pcan08 requested a review from timmo001 August 3, 2026 06:09
@timmo001
timmo001 removed their request for review August 10, 2026 13:02
@pcan08

pcan08 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Hi @timmo001,

Sorry to ping you, but I'd like to know if you still request changes from my side.
If yes, can you explain please because I already addressed your request about UiClockDateFormatSelector, so for me there is nothing else to address, unless I miss something.

Let me know please, note that I'll not be able to make any updates before the beginning of September, so nothing urgent for me, this is only to clarify the status of this PR.

@timmo001

timmo001 commented Aug 12, 2026

Copy link
Copy Markdown
Member

I took a short look, there are likely changes, but we should wait for UX before making any final technical changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed Needs UX Items requiring a review from the Home Assistant design team Noteworthy Marks a PR as noteworthy and should be in the release notes (in case it normally would not appear) Tests: Unit Related to Vitest unit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants