From 87efc44fa23dc66c4a272a74e11254030891f2ca Mon Sep 17 00:00:00 2001 From: itskovacs Date: Wed, 5 Nov 2025 17:54:54 +0100 Subject: [PATCH] :bug: Fix TZ issue on Trip creation daterange --- src/src/app/components/trips/trips.component.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/src/app/components/trips/trips.component.ts b/src/src/app/components/trips/trips.component.ts index 2dac90e..68286ec 100644 --- a/src/src/app/components/trips/trips.component.ts +++ b/src/src/app/components/trips/trips.component.ts @@ -113,9 +113,11 @@ export class TripsComponent implements OnInit { const tripDays: Partial[] = []; const current = new Date(from); while (current <= to) { - const day = current.getDate().toString().padStart(2, '0'); + const year = current.getUTCFullYear(); + const month = String(current.getMonth() + 1).padStart(2, '0'); + const day = String(current.getDate()).padStart(2, '0'); const label = `${day} ${months[current.getMonth()]}`; - tripDays.push({ label, dt: current.toISOString().split('T')[0] }); + tripDays.push({ label, dt: `${year}-${month}-${day}` }); current.setDate(current.getDate() + 1); } return tripDays;