mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +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: {
|
selector: {
|
||||||
select: {
|
select: {
|
||||||
mode: "dropdown",
|
mode: "dropdown",
|
||||||
options: Object.values(TimeFormat).map((value) => ({
|
options: ["auto", ...Object.values(TimeFormat)].map((value) => ({
|
||||||
value,
|
value,
|
||||||
label: localize(
|
label: localize(
|
||||||
`ui.panel.lovelace.editor.card.clock.time_formats.${value}`
|
`ui.panel.lovelace.editor.card.clock.time_formats.${value}`
|
||||||
@ -86,7 +86,7 @@ export class HuiClockCardEditor
|
|||||||
|
|
||||||
private _data = memoizeOne((config) => ({
|
private _data = memoizeOne((config) => ({
|
||||||
clock_size: "small",
|
clock_size: "small",
|
||||||
time_format: TimeFormat.language,
|
time_format: "auto",
|
||||||
show_seconds: false,
|
show_seconds: false,
|
||||||
...config,
|
...config,
|
||||||
}));
|
}));
|
||||||
@ -113,6 +113,10 @@ export class HuiClockCardEditor
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _valueChanged(ev: CustomEvent): void {
|
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 });
|
fireEvent(this, "config-changed", { config: ev.detail.value });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7163,6 +7163,7 @@
|
|||||||
"show_seconds": "Display seconds",
|
"show_seconds": "Display seconds",
|
||||||
"time_format": "Time format",
|
"time_format": "Time format",
|
||||||
"time_formats": {
|
"time_formats": {
|
||||||
|
"auto": "Use user settings",
|
||||||
"language": "[%key:ui::panel::profile::time_format::formats::language%]",
|
"language": "[%key:ui::panel::profile::time_format::formats::language%]",
|
||||||
"system": "[%key:ui::panel::profile::time_format::formats::system%]",
|
"system": "[%key:ui::panel::profile::time_format::formats::system%]",
|
||||||
"24": "[%key:ui::panel::profile::time_format::formats::24%]",
|
"24": "[%key:ui::panel::profile::time_format::formats::24%]",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user