mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
* Fix default time_format option. Fixes #24798 * Update en.json * Update src/translations/en.json --------- Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
724adab2d6
commit
e8e65a4293
@ -72,7 +72,7 @@ export class HuiClockCardEditor
|
||||
selector: {
|
||||
select: {
|
||||
mode: "dropdown",
|
||||
options: Object.values(TimeFormat).map((value) => ({
|
||||
options: ["auto", ...Object.values(TimeFormat)].map((value) => ({
|
||||
value,
|
||||
label: localize(
|
||||
`ui.panel.lovelace.editor.card.clock.time_formats.${value}`
|
||||
@ -86,7 +86,7 @@ export class HuiClockCardEditor
|
||||
|
||||
private _data = memoizeOne((config) => ({
|
||||
clock_size: "small",
|
||||
time_format: TimeFormat.language,
|
||||
time_format: "auto",
|
||||
show_seconds: false,
|
||||
...config,
|
||||
}));
|
||||
@ -113,6 +113,10 @@ export class HuiClockCardEditor
|
||||
}
|
||||
|
||||
private _valueChanged(ev: CustomEvent): void {
|
||||
if (ev.detail.value.time_format === "auto") {
|
||||
delete ev.detail.value.time_format;
|
||||
}
|
||||
|
||||
fireEvent(this, "config-changed", { config: ev.detail.value });
|
||||
}
|
||||
|
||||
|
@ -7163,6 +7163,7 @@
|
||||
"show_seconds": "Display seconds",
|
||||
"time_format": "Time format",
|
||||
"time_formats": {
|
||||
"auto": "Use user settings",
|
||||
"language": "[%key:ui::panel::profile::time_format::formats::language%]",
|
||||
"system": "[%key:ui::panel::profile::time_format::formats::system%]",
|
||||
"24": "[%key:ui::panel::profile::time_format::formats::24%]",
|
||||
|
Loading…
x
Reference in New Issue
Block a user