...
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 will only see the available dates following the selected arrival date. Also, the user
...
needs to
...
see the first
...
non-available date from the next interval as available, because
...
they can decide to check-out
...
that day (even if the property is not available to sleep, the check-out in the morning should be possible).
So, when the user clicks the “arrival calendar”, they will see something like this:
...
And when the user clicks the “departure calendar”:
...
, they will not see any future available dates (like the 30th and 31th of July), BUT they will see the first non-available date (the 16th of July) as selectable to check-out:
...
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.
...