diff --git a/src/panels/lovelace/editor/config-elements/hui-clock-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-clock-card-editor.ts index cbfffc1784..83a140b553 100644 --- a/src/panels/lovelace/editor/config-elements/hui-clock-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-clock-card-editor.ts @@ -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 }); } diff --git a/src/translations/en.json b/src/translations/en.json index ac1e18c203..ddb3c37d37 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -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%]",