- Clock Widget: fix bug, better default Handling for:

use12Hour, showSeconds
This commit is contained in:
Totto16 2022-11-22 10:41:42 +01:00
parent 5d5dd0a50e
commit 49334ae3c1
No known key found for this signature in database
GPG Key ID: 40285387F8ABE31B

View File

@ -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: {