Link Search Menu Expand Document

Accommodation availability

The accommodation_availability tag returns an array of Availability Day objects for all days in the first available month of the specified variant.

input
{% accommodation_availability variant %}
  {% for day in result.days %}
       <time data-available="{{ day.available }}" datetime="{{ day.date }}">{{ day.date | date:"%b %d, %y" }}</time>
  {% endfor %}
{% endaccommodation_availability %}
output
<time data-available="false" datetime="2023-02-01">Feb 01, 23</time>
<time data-available="false" datetime="2023-02-02">Feb 02, 23</time>
<time data-available="false" datetime="2023-02-03">Feb 03, 23</time>
.
.
.
<time data-available="true" datetime="2023-02-27">Feb 27, 23</time>
<time data-available="false" datetime="2023-02-28">Feb 28, 23</time>

The tag returns a availability_days array, the availability_days array represents all days of the month for the first available month. It defaults to 1 month at a time.

Extra parameters

It’s possible to use any of the following attributes in the accommodation availability tag itself, this is useful for building a page responsible for a specific type of product.

number_of_months

Passing a number will define the number of consecutive months that will be fetched. This defaults to 1, but can be passed a value as a Liquid variable or explicitly.

syntax
{% accommodation_availability variant, number_of_months: 2 %}
{% endaccommodation_availability %}