From 766a206055b44c7b55955136cb601dc2fb3d7a35 Mon Sep 17 00:00:00 2001 From: jarek Date: Fri, 31 Jul 2026 10:10:56 +0200 Subject: [PATCH] header clock falls back to the default timezone instead of utc --- src/lib/components/host-info.svelte | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/components/host-info.svelte b/src/lib/components/host-info.svelte index ae96f80..8a966f0 100644 --- a/src/lib/components/host-info.svelte +++ b/src/lib/components/host-info.svelte @@ -9,7 +9,7 @@ import { toast } from 'svelte-sonner'; import { themeStore, type FontSize } from '$lib/stores/theme'; import { formatBytes } from '$lib/utils/format'; - import { getTimeFormat } from '$lib/stores/settings'; + import { getTimeFormat, getDefaultTimezone } from '$lib/stores/settings'; // Font size scaling for header let fontSize = $state('normal'); @@ -332,8 +332,13 @@ hostInfo ? ((hostInfo.totalMemory - hostInfo.freeMemory) / hostInfo.totalMemory) * 100 : 0 ); + // Prefer the environment's own timezone; fall back to the GLOBAL default-timezone + // setting (not a hard-coded UTC). An env only STORES a timezone when it differs from + // the global default (EnvironmentModal: "save if not default"), so a plain env has no + // stored timezone and must inherit the user's chosen default here, not show UTC (#1340). let currentTimezone = $derived( - $environments.find((e: Environment) => Number(e.id) === Number(currentEnvId))?.timezone ?? 'UTC' + $environments.find((e: Environment) => Number(e.id) === Number(currentEnvId))?.timezone + || getDefaultTimezone() ); function formatLastUpdated(date: Date, timezone: string): string {