-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Add date card feature #26531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add date card feature #26531
Conversation
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" |
src/panels/lovelace/editor/config-elements/hui-card-features-editor.ts
Outdated
Show resolved
Hide resolved
// datetime requires a full datetime string | ||
if (domain === "datetime") { | ||
const dateObj = new Date(this._stateObj.state); | ||
const newDate = value.split("-").map(Number); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
* Add date card feature * Rename from "date" to "date-set" * Better label * Fix * Parse date for datetime
* 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>
Breaking change
Proposed change
Supports the
date
,datetime
andinput_datetime
domains (input datetime if the attributehas_date
exists)Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: