🔀 Merge pull request #982 from Totto16/master

- Clock Widget: fix bug, better default Handling for:  use12Hour, showSeconds
This commit is contained in:
Alicia Sykes
2022-11-26 00:44:30 +00:00
committed by GitHub
2 changed files with 4 additions and 2 deletions

View File

@@ -40,7 +40,9 @@ export default {
return !this.options.hideSeconds;
},
use12Hour() {
return !this.options.use12Hour;
if (typeof this.options.use12Hour === "boolean") 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: {