From bdeaa9a561917730b20d15c34bb74655cbfd1376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Sun, 11 Sep 2022 22:49:17 +0000 Subject: [PATCH] Clock update instantly + slower interval --- ui/src/components/Clock.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ui/src/components/Clock.vue b/ui/src/components/Clock.vue index a2a2dc1..d20b384 100644 --- a/ui/src/components/Clock.vue +++ b/ui/src/components/Clock.vue @@ -14,12 +14,15 @@ export default class Clock extends Vue { @Prop() public format!: string; + private update(): void { + this.formatted = DateTime.now() + .setLocale(navigator.language) + .toFormat(this.format); + } + public created(): void { - this.interval = setInterval((): void => { - this.formatted = DateTime.now() - .setLocale(navigator.language) - .toFormat(this.format); - }, 1000); + this.update(); + this.interval = setInterval(this.update, 10000); } public beforeDestroy(): void {