fix(fe login/header): fixed getting the right timezone at login
This commit is contained in:
parent
0498f2fe08
commit
1c3ed7f590
4 changed files with 24 additions and 25 deletions
|
@ -1,14 +1,15 @@
|
|||
<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(new Date().toLocaleString("it-IT", {timeZone: timezone}));
|
||||
const time = ref(DateTime.now().setZone(timezone).setLocale('it').toLocaleString(DateTime.DATETIME_FULL_WITH_SECONDS));
|
||||
|
||||
setInterval(() => {
|
||||
time.value = new Date().toLocaleString("it-IT", {timeZone: timezone});
|
||||
time.value = DateTime.now().setZone(timezone).setLocale('it').toLocaleString(DateTime.DATETIME_FULL_WITH_SECONDS)
|
||||
}, 1000)
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue