From 4e91e9dca134fd9cabde2825f14f176a04576577 Mon Sep 17 00:00:00 2001 From: gnezim Date: Sat, 18 Apr 2026 14:00:03 +0300 Subject: [PATCH] Display wall-clock times in TimeGroup instead of reprojecting formatTime runs new Date(iso).getHours() which reprojects the timestamp through the browser's local timezone. For a flight arriving at 06:30 in Almaty (GMT+5) a viewer in Moscow saw '04:30'. Switch the TimeGroup component to formatLocalTime which reads the wall-clock directly out of the offset-aware ISO string, matching the rest of the details/timetable views. --- src/ui/flights/TimeGroup.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ui/flights/TimeGroup.tsx b/src/ui/flights/TimeGroup.tsx index 1c3631ce..57147470 100644 --- a/src/ui/flights/TimeGroup.tsx +++ b/src/ui/flights/TimeGroup.tsx @@ -1,5 +1,5 @@ import type { FC } from "react"; -import { formatTime } from "@/shared/utils/datetime/index.js"; +import { formatLocalTime } from "@/shared/utils/datetime/index.js"; import "./TimeGroup.scss"; export interface TimeGroupProps { @@ -25,8 +25,12 @@ export const TimeGroup: FC = ({ dayChange, label, }) => { - const scheduledTime = formatTime(scheduled); - const actualTime = actual ? formatTime(actual) : undefined; + // formatLocalTime reads the wall-clock from the offset-aware ISO + // string, so a flight arriving at 06:30 in Almaty (GMT+5) reads + // 06:30 regardless of the viewer's timezone. formatTime would + // reproject through new Date() and show '04:30' in Moscow. + const scheduledTime = formatLocalTime(scheduled); + const actualTime = actual ? formatLocalTime(actual) : undefined; const hasDelay = actualTime !== undefined && actualTime !== scheduledTime; return (