Option to hide seconds in Clock (#644)

This commit is contained in:
Alicia Sykes
2022-05-11 10:52:16 +01:00
parent bcb1b70447
commit 4287092ea2
2 changed files with 5 additions and 1 deletions

View File

@@ -36,6 +36,9 @@ export default {
if (this.options.customCityName) return this.options.customCityName;
return this.timeZone.split('/')[1].replaceAll('_', ' ');
},
showSeconds() {
return !this.options.hideSeconds;
},
},
methods: {
update() {
@@ -48,7 +51,7 @@ export default {
timeZone: this.timeZone,
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
...(this.showSeconds && { second: 'numeric' }),
}).format();
},
/* Get and format the date */