26 lines
No EOL
613 B
Vue
26 lines
No EOL
613 B
Vue
<script setup lang="ts">
|
|
import {useAuthStore} from "@/stores/auth.store.ts";
|
|
import {computed, ref} from "vue";
|
|
import {DateTime} from "luxon";
|
|
|
|
const auth = useAuthStore();
|
|
const timezone = auth.userData.timezone;
|
|
|
|
const time = ref(DateTime.now().setZone(timezone).setLocale('it').toLocaleString(DateTime.DATETIME_FULL_WITH_SECONDS));
|
|
|
|
setInterval(() => {
|
|
time.value = DateTime.now().setZone(timezone).setLocale('it').toLocaleString(DateTime.DATETIME_FULL_WITH_SECONDS)
|
|
}, 1000)
|
|
</script>
|
|
|
|
<template>
|
|
<div class="timer">
|
|
<span>
|
|
{{ time }}
|
|
</span>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
|
|
</style> |