Merged in fix/BOOK-662-handle-overlapping-dates-timezone (pull request #3319)
Fix/BOOK-662 handle overlapping dates timezone * fix(BOOK-662): handle overlapping dates alerts * fix(BOOK-662): handle overlapping dates alerts * fix(BOOK-662): add test same dates Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -2,10 +2,10 @@ import { cookies } from "next/headers"
|
||||
|
||||
import { FamilyAndFriendsCodes } from "@scandic-hotels/common/constants/familyAndFriends"
|
||||
import { dt } from "@scandic-hotels/common/dt"
|
||||
import { hasOverlappingDates } from "@scandic-hotels/common/dt/utils/hasOverlappingDates"
|
||||
import { HotelInfoCard } from "@scandic-hotels/design-system/HotelInfoCard"
|
||||
|
||||
import { mapApiImagesToGalleryImages } from "../../misc/imageGallery"
|
||||
import { filterOverlappingDates } from "../../utils/SelectRate"
|
||||
import FnFNotAllowedAlert from "../FnFNotAllowedAlert"
|
||||
import { HotelDetailsSidePeek } from "../HotelDetailsSidePeek"
|
||||
import { AmenitiesSidePeekLabel } from "./AmenititesSidePeekLabel"
|
||||
@@ -33,10 +33,10 @@ export async function SelectRate({
|
||||
isInValidFNF = cookieStore.get("sc")?.value !== "1"
|
||||
}
|
||||
|
||||
const validAlerts = hotelData.hotel.specialAlerts.filter(
|
||||
(alert) =>
|
||||
hasOverlappingDates(alert, dt(booking.fromDate), dt(booking.toDate)) &&
|
||||
alert.displayInBookingFlow
|
||||
const validAlerts = filterOverlappingDates(
|
||||
hotelData.hotel.specialAlerts.filter((alert) => alert.displayInBookingFlow),
|
||||
dt.utc(booking.fromDate),
|
||||
dt.utc(booking.toDate)
|
||||
)
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user