From 49334ae3c1fb9c86f1e8c3769e9ffe9893cb6a5a Mon Sep 17 00:00:00 2001 From: Totto16 Date: Tue, 22 Nov 2022 10:41:42 +0100 Subject: [PATCH] - Clock Widget: fix bug, better default Handling for: use12Hour, showSeconds --- src/components/Widgets/Clock.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/Widgets/Clock.vue b/src/components/Widgets/Clock.vue index d72eb1ab..f2d351ee 100644 --- a/src/components/Widgets/Clock.vue +++ b/src/components/Widgets/Clock.vue @@ -37,10 +37,14 @@ export default { return this.timeZone.split('/')[1].replaceAll('_', ' '); }, showSeconds() { - return !this.options.hideSeconds; + if (this.options.hideSeconds) return this.options.hideSeconds; + // this is the default + return true; }, use12Hour() { - return !this.options.use12Hour; + if (this.options.use12Hour) return this.options.use12Hour; + // this is the default, it gets computed by the DateTimeFormat implementation + return Intl.DateTimeFormat(this.timeFormat, { timeZone: this.timeZone, hour: 'numeric' }).resolvedOptions().hour12 ?? false; }, }, methods: {