fix: display modify dates for already guaranteed changeable rates

This commit is contained in:
Simon Emanuelsson
2025-04-03 15:51:38 +02:00
committed by Michael Zetterberg
parent b8a976db22
commit 2abd4c5c12
17 changed files with 94 additions and 205 deletions

View File

@@ -1,7 +1,6 @@
import { metrics } from "@opentelemetry/api"
import * as api from "@/lib/api"
import { dt } from "@/lib/dt"
import { badRequestError, serverErrorByStatus } from "@/server/errors/trpc"
import {
router,
@@ -145,24 +144,6 @@ export const bookingQueryRouter = router({
})
)
/**
* Add hotels check in and out times to booking check in and out date
* as that is date only (YYYY-MM-DD)
*/
const checkInTime = hotelData.hotel.hotelFacts.checkin.checkInTime
const [checkInHour, checkInMinute] = checkInTime.split(":")
const checkIn = dt(booking.data.checkInDate)
.set("hour", Number(checkInHour))
.set("minute", Number(checkInMinute))
const checkOutTime = hotelData.hotel.hotelFacts.checkin.checkOutTime
const [checkOutHour, checkOutMinute] = checkOutTime.split(":")
const checkOut = dt(booking.data.checkOutDate)
.set("hour", Number(checkOutHour))
.set("minute", Number(checkOutMinute))
booking.data.checkInDate = checkIn.toDate()
booking.data.checkOutDate = checkOut.toDate()
return {
...hotelData,
booking: booking.data,