Skip to content

Conversation

timmo001
Copy link
Member

@timmo001 timmo001 commented Aug 14, 2025

Breaking change

Proposed change

Supports the date, datetime and input_datetime domains (input datetime if the attribute has_date exists)

image 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

Example configuration

features:
  - type: date

Additional information

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

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

@timmo001
Copy link
Member Author

Wanted to match the design of other cards (reuse the button feature), but wasn't sure if this should use the date value or not. I think since the state is the value and this will likely always be the state content, it made sense to use "Set date"

@timmo001 timmo001 marked this pull request as ready for review August 14, 2025 10:27
@MindFreeze MindFreeze added the Noteworthy Marks a PR as noteworthy and should be in the release notes (in case it normally would not appear) label Aug 15, 2025
@timmo001 timmo001 requested a review from MindFreeze August 15, 2025 14:48
// datetime requires a full datetime string
if (domain === "datetime") {
const dateObj = new Date(this._stateObj.state);
const newDate = value.split("-").map(Number);
Copy link
Member

Choose a reason for hiding this comment

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

Is value always in the same format? I would expect it to depend on the locale, in which case you convert it to a js Date and get the values from that

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to parse date instead of string splitting: 45de7f6

Copy link
Member

Choose a reason for hiding this comment

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

I was just testing it and saw the format is always the same but this doesn't hurt I guess

@MindFreeze MindFreeze enabled auto-merge (squash) August 18, 2025 09:56
@MindFreeze MindFreeze merged commit d528ab0 into home-assistant:dev Aug 18, 2025
11 checks passed
MindFreeze pushed a commit that referenced this pull request Aug 20, 2025
* Add date card feature

* Rename from "date" to "date-set"

* Better label

* Fix

* Parse date for datetime
MindFreeze added a commit that referenced this pull request Aug 20, 2025
* Bar graph card feature for sensors

* use state color

* tweak name

* rename and improve colors

* Update src/panels/lovelace/card-features/hui-progress-bar-card-feature.ts

Co-authored-by: Paul Bottein <paul.bottein@gmail.com>

* rename to Bar gauge

* name fix

* Force dark-only themes to be in dark mode (#26583)

* Fetch translations for switch-as-x domains (#26566)

* Fetch translations for switch-as-x domains

* no cache

* Migrate ha-progress-ring to webawesome (#26542)

* Migrate all sl-animation usages to wa-animation (#26544)

* Remove unused shoelace animation import (#26584)

* Bump actions/checkout from 4.2.2 to 5.0.0 (#26586)

Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.2 to 5.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4.2.2...v5.0.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add date card feature (#26531)

* Add date card feature

* Rename from "date" to "date-set"

* Better label

* Fix

* Parse date for datetime

* Show accurate state of show_header_toggle in entities card editor (#26564)

* Add clipboard support to condition card conditions (#26535)

* Add copy paste support to condition card conditions

* Don't clear the clipboard

* Fix selection

* Add cut and duplicate

* Remove

* Fix event

* Fix picture glance mouse pointer (#26391)

* Fix picture glance mouse pointer

* More action updates

* Capitalize "Samba" as the name of the Open Source project (#26590)

Capitalize "Samba" as name for the Open Source project

* Update dependency @codemirror/language to v6.11.3 (#26589)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Set default forecast option in weather forecast card editor (#26592)

* Add fan oscillate feature (#26519)

* First working fan-oscillate feature

This a first working impl, need at least to do:
- Tooltip not yet "Yes/No"
- Need implementation verification

* Use same strings as more info label for control tooltip

* Add missing label for editor

* Rename some variables

* Add fan features in gallery

* Fix lint:types by applying suggestions from code review

Co-authored-by: Aidan Timson <aidan@timmo.dev>

* fix lint new line after import

* fix typo

Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>

* fix event value type treating

* remove type magic as suggested

Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>

* Update localize.ts

Complete suggestion change to have tooltip

* fix lint by removing unused import

---------

Co-authored-by: Aidan Timson <aidan@timmo.dev>
Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>

* Lock file maintenance (#26598)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Fix legend in devices-detail-graph (#26596)

* Change Suggest with AI label to Suggest (#26603)

* Automation row remember collapsed status (#26604)

* Summaries overview dashboard (#26594)

* Change categories to lights, climate and security

* Add entities grouped by devices

* Fix garage cover device class

* Rename category to summary

* Add media players categories

* Reduce spacing

* Remove person

* Remove translations

* Use media player cards

* Display entities without device

* Add missing entity category

* Update src/panels/lovelace/strategies/overview/helpers/overview-summaries.ts

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Add white space

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Fix entities not showing due to JavaScript crash (fixes #25363) (#26599)

* Fix entity UI crash from undefined entity names (fixes #25363)

* Fix mock function type compatibility in test

- Update mock to handle string | undefined parameter
- Maintain test functionality while satisfying type checker

* Simplify approach based on reviewer feedback

- Use String() coercion to preserve numeric entity names (e.g., power strip outlets)
- Single line change instead of complex type validation across multiple files
- Revert stripPrefixFromEntityName to original (no longer needs null handling)
- Remove separate test file, update existing test to expect stringified numbers
- More conservative approach that preserves data rather than replacing with fallbacks

* History chart card feature (#26555)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Fix space in overview welcome caption (#26618)

* Fix space in overview welcome caption

* Update src/panels/lovelace/strategies/overview/overview-home-view-strategy.ts

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Paul Bottein <paul.bottein@gmail.com>
Co-authored-by: karwosts <32912880+karwosts@users.noreply.github.com>
Co-authored-by: Simon Lamon <32477463+silamon@users.noreply.github.com>
Co-authored-by: Wendelin <12148533+wendevlin@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Aidan Timson <aidan@timmo.dev>
Co-authored-by: Norbert Rittel <norbert@rittel.de>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: pcan08 <155250376+pcan08@users.noreply.github.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Drinor Dalipi <45405217+Drinory@users.noreply.github.com>
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed Noteworthy Marks a PR as noteworthy and should be in the release notes (in case it normally would not appear)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Date card feature
2 participants