From f84388841a8284a9c3da8944bbfe8c0c0dcc5c82 Mon Sep 17 00:00:00 2001 From: bartwr Date: Wed, 3 Apr 2024 17:24:05 +0200 Subject: [PATCH] Add temporary quick fix for showing correct time --- src/components/ParkingFacilityBlock.tsx | 4 ++-- src/components/parking/ParkingEditOpening.tsx | 4 ++-- src/utils/parkings.tsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/ParkingFacilityBlock.tsx b/src/components/ParkingFacilityBlock.tsx index 6701b0d..574da50 100644 --- a/src/components/ParkingFacilityBlock.tsx +++ b/src/components/ParkingFacilityBlock.tsx @@ -37,8 +37,8 @@ type ParkingType = { const isOpen = (openingTime: Date, closingTime: Date, isNS: boolean = false): boolean => { const now = new Date(); const currentTime = now.getHours() * 60 + now.getMinutes(); - const opening = openingTime.getHours() * 60 + openingTime.getMinutes(); - let closing = closingTime.getHours() * 60 + closingTime.getMinutes(); + const opening = openingTime.getHours() - 1 * 60 + openingTime.getMinutes();//TODO + let closing = closingTime.getHours() - 1 * 60 + closingTime.getMinutes();//TODO // #TODO: Combine functions with /src/utils/parkings.tsx if (opening === closing && opening === 60 && closing === 60) { diff --git a/src/components/parking/ParkingEditOpening.tsx b/src/components/parking/ParkingEditOpening.tsx index 95c995a..bb13f2c 100644 --- a/src/components/parking/ParkingEditOpening.tsx +++ b/src/components/parking/ParkingEditOpening.tsx @@ -46,11 +46,11 @@ const formatOpeningTimesForEdit = ( const wkday = new Date().getDay(); const tmpopen: Date = new Date(parkingdata[getOpenTimeKey(day)]); - const hoursopen = tmpopen.getHours(); + const hoursopen = tmpopen.getHours() - 1;//TODO const minutesopen = String(tmpopen.getMinutes()).padStart(2, "0"); const tmpclose: Date = new Date(parkingdata[getDichtTimeKey(day)]); - const hoursclose = tmpclose.getHours(); + const hoursclose = tmpclose.getHours() - 1;//TODO const minutesclose = String(tmpclose.getMinutes()).padStart(2, "0"); let value = `${hoursopen}:${minutesopen} - ${hoursclose}:${minutesclose}`; diff --git a/src/utils/parkings.tsx b/src/utils/parkings.tsx index 2743b13..029ea61 100644 --- a/src/utils/parkings.tsx +++ b/src/utils/parkings.tsx @@ -90,11 +90,11 @@ export const formatOpeningTimes = ( console.log('parkingdata[getOpenTimeKey(day)]', parkingdata[getOpenTimeKey(day)]); const tmpopen: Date = new Date(parkingdata[getOpenTimeKey(day)]); - const hoursopen = tmpopen.getHours(); + const hoursopen = tmpopen.getHours() - 1;//TODO const minutesopen = String(tmpopen.getMinutes()).padStart(2, "0"); const tmpclose: Date = new Date(parkingdata[getDichtTimeKey(day)]); - const hoursclose = tmpclose.getHours(); + const hoursclose = tmpclose.getHours() - 1;//TODO const minutesclose = String(tmpclose.getMinutes()).padStart(2, "0"); let value = `${hoursopen}:${minutesopen} - ${hoursclose}:${minutesclose}`;