Track dates as strings
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { differenceInCalendarDays,isWeekend } from "date-fns"
|
import { differenceInCalendarDays, format,isWeekend } from "date-fns"
|
||||||
|
|
||||||
import { Lang } from "@/constants/languages"
|
import { Lang } from "@/constants/languages"
|
||||||
import { selectHotelMap } from "@/constants/routes/hotelReservation"
|
import { selectHotelMap } from "@/constants/routes/hotelReservation"
|
||||||
@@ -32,7 +32,7 @@ export default async function SelectHotelPage({
|
|||||||
|
|
||||||
const tempSearchTerm = "Stockholm"
|
const tempSearchTerm = "Stockholm"
|
||||||
const tempArrivalDate = new Date("2024-10-25")
|
const tempArrivalDate = new Date("2024-10-25")
|
||||||
const tempDepartureDate = new Date("2024-10-25")
|
const tempDepartureDate = new Date("2024-10-26")
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
|
|
||||||
const hotels = await fetchAvailableHotels({
|
const hotels = await fetchAvailableHotels({
|
||||||
@@ -56,8 +56,8 @@ export default async function SelectHotelPage({
|
|||||||
const hotelsTrackingData: TrackingSDKHotelInfo = {
|
const hotelsTrackingData: TrackingSDKHotelInfo = {
|
||||||
availableResults: hotels.length,
|
availableResults: hotels.length,
|
||||||
searchTerm: tempSearchTerm,
|
searchTerm: tempSearchTerm,
|
||||||
arrivalDate: tempArrivalDate,
|
arrivalDate: format(tempArrivalDate, "yyyy-MM-dd"),
|
||||||
departureDate: tempDepartureDate,
|
departureDate: format(tempDepartureDate, "yyyy-MM-dd"),
|
||||||
noOfAdults: 1, // TODO: Use values from searchParams
|
noOfAdults: 1, // TODO: Use values from searchParams
|
||||||
noOfChildren: 0, // TODO: Use values from searchParams
|
noOfChildren: 0, // TODO: Use values from searchParams
|
||||||
noOfRooms: 1, // TODO: Use values from searchParams
|
noOfRooms: 1, // TODO: Use values from searchParams
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ export type TrackingSDKUserData = {
|
|||||||
|
|
||||||
export type TrackingSDKHotelInfo = {
|
export type TrackingSDKHotelInfo = {
|
||||||
hotelID?: string
|
hotelID?: string
|
||||||
arrivalDate?: Date
|
arrivalDate?: string
|
||||||
departureDate?: Date
|
departureDate?: string
|
||||||
noOfAdults?: number
|
noOfAdults?: number
|
||||||
noOfChildren?: number
|
noOfChildren?: number
|
||||||
ageOfChildren?: string // "10", "2,5,10"
|
ageOfChildren?: string // "10", "2,5,10"
|
||||||
|
|||||||
Reference in New Issue
Block a user