Returns the availability of a property for the number of months that are passed in the parameters. Used to create the calendar in the listing’s page.
Request: Calendar(propertyID, datefrom, months, usr, pwd)
parameter | type | format | required? |
---|---|---|---|
propertyID | integer | Yes | |
datefrom | string | yyyy-MM-dd | Yes |
months | integer | Yes | |
usr | integer | Yes | |
pwd | string | Yes |
Response:
In the response you will get each day of the calendar, from the ‘datefrom’ to the last day of the number of months, with the minimum stay and the availability for each day.
{ "Calendar": { "lodging_id": "1001", "date": "2024-01-01", "minimum_stay": "3", "available": true },{ "lodging_id": "1001", "date": "2024-01-02", "minimum_stay": "3", "available": false } }
Option 1: Informative calendar
If you want to create a calendar to inform the user of the availability, but without any type of interaction, like this one:
You need to read the date and the available parameters for each date, and then create each month will the appropiate styles for available/not-available.
Option 2: Interactive calendar
If you want to create a calendar to pick the available dates, to be able to book the property, like this one:
You should create 3 different arrays reading the Calendar function, to use later on in the calendar library that you are using in your frontend.
The arrays will be:
non_available_for_arrival_calendar
non_available_for_departure_calendar
minimum_stay
You need 2 arrays for the availability because in the “arrival” calendar the user will see all days that are available, BUT in the “departure” calendar, the user should be able to select the first day in a non-available interval, because this is to check-out of the property, it doesn’t matter if the property is not available to sleep.
So, when the user clicks the “arrival calendar”:
And when the user clicks the “departure calendar”:
You can also add another step, and read the “minimum_stay” array so that when the user selects a check-in date, the check-out automatically goes to the first available date, taking into account the minimum-stay.
We are missing the closed_to_arrival, closed_to_departure and release restrictions in this function.
When we add these restrictions, we will have all the restriction options from the system.