11<script setup lang="ts">
2- import SecondaryButton from " @/packages/ui/src/Buttons/SecondaryButton.vue" ;
3- import DialogModal from " @/packages/ui/src/DialogModal.vue" ;
4- import PrimaryButton from " @/packages/ui/src/Buttons/PrimaryButton.vue" ;
5- import { onMounted , ref } from " vue" ;
6- import { getUserTimezone } from " @/packages/ui/src/utils/settings" ;
7- import { getDayJsInstance } from " @/packages/ui/src/utils/time" ;
8- import { useForm , usePage } from " @inertiajs/vue3" ;
9- import type { User } from " @/types/models" ;
10- import { useSessionStorage } from " @vueuse/core" ;
2+ import SecondaryButton from ' @/packages/ui/src/Buttons/SecondaryButton.vue' ;
3+ import DialogModal from ' @/packages/ui/src/DialogModal.vue' ;
4+ import PrimaryButton from ' @/packages/ui/src/Buttons/PrimaryButton.vue' ;
5+ import { onMounted , ref } from ' vue' ;
6+ import { getUserTimezone } from ' @/packages/ui/src/utils/settings' ;
7+ import { getDayJsInstance } from ' @/packages/ui/src/utils/time' ;
8+ import { useForm , usePage } from ' @inertiajs/vue3' ;
9+ import type { User } from ' @/types/models' ;
10+ import { useSessionStorage } from ' @vueuse/core' ;
1111
12- const show = defineModel (" show" , { default: false });
13- const saving = defineModel (" saving" , { default: false });
12+ const show = defineModel (' show' , { default: false });
13+ const saving = defineModel (' saving' , { default: false });
1414
15- const timezone = ref (" " );
16- const userTimezone = ref (" " );
15+ const timezone = ref (' ' );
16+ const userTimezone = ref (' ' );
1717
1818const page = usePage <{
1919 auth: {
2020 user: User ;
2121 };
2222}>();
2323
24- const hideTimezoneMismatchModal = useSessionStorage <boolean >(
25- ' hide-timezone-mismatch-modal' ,
26- false
27- );
24+ const hideTimezoneMismatchModal = useSessionStorage <boolean >(' hide-timezone-mismatch-modal' , false );
2825
2926onMounted (() => {
3027 timezone .value = Intl .DateTimeFormat ().resolvedOptions ().timeZone ;
3128 userTimezone .value = getUserTimezone ();
3229
33- if (getDayJsInstance ()().tz (timezone .value ).format () !== getDayJsInstance ()().tz (userTimezone .value ).format ()
34- && ! hideTimezoneMismatchModal .value
30+ if (
31+ getDayJsInstance ()().tz (timezone .value ).format () !==
32+ getDayJsInstance ()().tz (userTimezone .value ).format () &&
33+ ! hideTimezoneMismatchModal .value
3534 ) {
3635 show .value = true ;
3736 }
3837});
3938
40- function submit(){
39+ function submit() {
4140 saving .value = true ;
4241 const form = useForm ({
4342 _method: ' PUT' ,
@@ -54,15 +53,14 @@ function submit(){
5453 saving .value = false ;
5554 show .value = false ;
5655 location .reload ();
57- }
56+ },
5857 });
5958}
6059
61- function cancel(){
60+ function cancel() {
6261 show .value = false ;
6362 hideTimezoneMismatchModal .value = true ;
6463}
65-
6664 </script >
6765
6866<template >
@@ -76,13 +74,18 @@ function cancel(){
7674 <div class =" flex items-center space-x-4" >
7775 <div class =" col-span-6 sm:col-span-4 flex-1 space-y-2" >
7876 <p >
79- The timezone of your device does not match the timezone in your user settings. <br >
80- <strong >We highly recommend that you update your timezone settings to your current
81- timezone.</strong >
77+ The timezone of your device does not match the timezone in your user
78+ settings. <br />
79+ <strong
80+ >We highly recommend that you update your timezone settings to your
81+ current timezone.</strong
82+ >
8283 </p >
8384
8485 <p >
85- Want to change your timezone setting from <strong >{{ userTimezone }}</strong > to <strong >{{ timezone }}</strong >.
86+ Want to change your timezone setting from
87+ <strong >{{ userTimezone }}</strong > to <strong >{{ timezone }}</strong
88+ >.
8689 </p >
8790 </div >
8891 </div >
0 commit comments