@@ -5,11 +5,13 @@ import { Plus, LoaderCircle, X } from 'lucide-vue-next'
55import { registerServer } from ' ../api/servers'
66import type { RegisterServerBody } from ' ../api/servers'
77import { useServers } from ' ../composables/useServers'
8+ import { useDisplayTimezone } from ' ../composables/useDisplayTimezone'
89
910const router = useRouter ()
1011
1112// Shared server state
1213const { servers, loading, error : fetchError, fetch : fetchServers, ensureLoaded } = useServers ()
14+ const { selectedIana } = useDisplayTimezone ()
1315
1416onMounted (ensureLoaded )
1517
@@ -19,15 +21,17 @@ function formatBytes(bytes: number): string {
1921}
2022
2123function formatDate(iso : string ): string {
22- const d = new Date (iso )
23- const dd = String (d .getDate ()).padStart (2 , ' 0' )
24- const mm = String (d .getMonth () + 1 ).padStart (2 , ' 0' )
25- const yy = String (d .getFullYear ()).slice (2 )
26- return ` ${dd }/${mm }/${yy } `
24+ return new Date (iso ).toLocaleDateString (' en-GB' , {
25+ timeZone: selectedIana .value ,
26+ day: ' 2-digit' ,
27+ month: ' 2-digit' ,
28+ year: ' 2-digit' ,
29+ })
2730}
2831
2932function formatTime(iso : string ): string {
3033 return new Date (iso ).toLocaleTimeString (' en-GB' , {
34+ timeZone: selectedIana .value ,
3135 hour: ' 2-digit' ,
3236 minute: ' 2-digit' ,
3337 second: ' 2-digit' ,
0 commit comments