From efcdbd94fbb1d0d0a8b7a13cc35cc4b666358296 Mon Sep 17 00:00:00 2001 From: jubnl Date: Tue, 25 Aug 2026 00:44:42 +0200 Subject: [PATCH] fix(client): compute "today" from the local calendar, not UTC --- .../Journey/JourneyDetailPageDatePicker.tsx | 3 +- .../JourneyDetailPageEntryEditor.test.tsx | 3 +- .../Journey/JourneyDetailPageEntryEditor.tsx | 5 +- .../components/Planner/ReservationModal.tsx | 3 +- .../shared/CustomDateTimePicker.test.tsx | 3 +- .../shared/CustomDateTimePicker.tsx | 3 +- .../screens/journey/MJourneyEntrySheet.tsx | 5 +- client/src/pages/DashboardPage.test.tsx | 7 +- client/src/pages/JourneyDetailPage.test.tsx | 3 +- client/src/pages/JourneyPage.tsx | 5 +- client/src/pages/JourneyPage.wiring.test.tsx | 3 +- .../pages/dashboard/dashboardModel.test.ts | 134 ++++++------------ client/src/pages/dashboard/dashboardModel.ts | 14 +- client/src/pages/dashboard/useDashboard.ts | 3 +- client/src/utils/journeyLifecycle.test.ts | 30 ++++ client/src/utils/journeyLifecycle.ts | 8 +- client/src/utils/localDate.test.ts | 28 ++++ client/src/utils/localDate.ts | 16 +++ .../unit/mobile/dashboard/MDashboard.test.tsx | 5 +- .../journey/MJourneyEntrySheet.test.tsx | 5 +- 20 files changed, 171 insertions(+), 115 deletions(-) create mode 100644 client/src/utils/localDate.test.ts create mode 100644 client/src/utils/localDate.ts diff --git a/client/src/components/Journey/JourneyDetailPageDatePicker.tsx b/client/src/components/Journey/JourneyDetailPageDatePicker.tsx index 4b35ef0be..fad10d826 100644 --- a/client/src/components/Journey/JourneyDetailPageDatePicker.tsx +++ b/client/src/components/Journey/JourneyDetailPageDatePicker.tsx @@ -1,4 +1,5 @@ import { useState } from 'react' +import { localIsoDate } from '../../utils/localDate' import { ArrowLeft, ChevronRight, Calendar } from 'lucide-react' import { useTranslation } from '../../i18n' @@ -81,7 +82,7 @@ export function DatePicker({ value, onChange, tripDates }: { const dateStr = `${viewMonth.year}-${pad(viewMonth.month + 1)}-${pad(day)}` const isSelected = dateStr === value const isTrip = tripDates?.has(dateStr) - const isToday = dateStr === new Date().toISOString().split('T')[0] + const isToday = dateStr === localIsoDate() return (