subtask/ SW-683 Fixed params naming
This commit is contained in:
@@ -33,10 +33,10 @@ export default function MobileToggleButton({
|
|||||||
? JSON.parse(decodeURIComponent(location))
|
? JSON.parse(decodeURIComponent(location))
|
||||||
: null
|
: null
|
||||||
|
|
||||||
const nights = dt(d.to).diff(dt(d.from), "days")
|
const nights = dt(d.toDate).diff(dt(d.fromDate), "days")
|
||||||
|
|
||||||
const selectedFromDate = dt(d.from).locale(lang).format("D MMM")
|
const selectedFromDate = dt(d.fromDate).locale(lang).format("D MMM")
|
||||||
const selectedToDate = dt(d.to).locale(lang).format("D MMM")
|
const selectedToDate = dt(d.toDate).locale(lang).format("D MMM")
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setHasMounted(true)
|
setHasMounted(true)
|
||||||
|
|||||||
@@ -100,13 +100,21 @@ export default function DatePickerForm({ name = "date" }: DatePickerFormProps) {
|
|||||||
close={close}
|
close={close}
|
||||||
handleOnSelect={handleSelectDate}
|
handleOnSelect={handleSelectDate}
|
||||||
locales={locales}
|
locales={locales}
|
||||||
selectedDate={selectedDate}
|
// DayPicker lib needs Daterange in form as below to show appropriate UI
|
||||||
|
selectedDate={{
|
||||||
|
from: selectedDate.fromDate,
|
||||||
|
to: selectedDate.toDate,
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<DatePickerMobile
|
<DatePickerMobile
|
||||||
close={close}
|
close={close}
|
||||||
handleOnSelect={handleSelectDate}
|
handleOnSelect={handleSelectDate}
|
||||||
locales={locales}
|
locales={locales}
|
||||||
selectedDate={selectedDate}
|
// DayPicker lib needs Daterange in form as below to show appropriate UI
|
||||||
|
selectedDate={{
|
||||||
|
from: selectedDate.fromDate,
|
||||||
|
to: selectedDate.toDate,
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -33,10 +33,7 @@ export default function Form({ locations, type }: BookingWidgetFormProps) {
|
|||||||
|
|
||||||
const bookingFlowPage =
|
const bookingFlowPage =
|
||||||
locationData.type == "cities" ? selectHotel[lang] : selectRate[lang]
|
locationData.type == "cities" ? selectHotel[lang] : selectRate[lang]
|
||||||
const bookingWidgetParams = new URLSearchParams({
|
const bookingWidgetParams = new URLSearchParams(data.date)
|
||||||
fromDate: data.date.from,
|
|
||||||
toDate: data.date.to,
|
|
||||||
})
|
|
||||||
|
|
||||||
if (locationData.type == "cities")
|
if (locationData.type == "cities")
|
||||||
bookingWidgetParams.set("city", locationData.name)
|
bookingWidgetParams.set("city", locationData.name)
|
||||||
|
|||||||
Reference in New Issue
Block a user