Skip to content

Commit

Permalink
Add temporary quick fix for showing correct time
Browse files Browse the repository at this point in the history
  • Loading branch information
bartwr committed Apr 3, 2024
1 parent 5e604da commit f843888
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/components/ParkingFacilityBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/components/parking/ParkingEditOpening.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down
4 changes: 2 additions & 2 deletions src/utils/parkings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down

0 comments on commit f843888

Please sign in to comment.