Availability day

A single day's availability and pricing for an accommodation variant.

A single day's availability and pricing for an accommodation variant. Returned by the accommodation availability tag.

Properties

availability_status

A high-level availability signal for this date, so themes can show "limited"/"running low" states without deriving them from the raw remaining count. An externally stocked night reports the stock manager's status. Not available (see #available) is treated as the "sold out" bucket here.

Returns: String — one of "available", "limited", or "sold_out".

See also: StockManagement::AvailabilityStatus

available

Whether the accommodation is bookable on this date.

When the variant uses a resources stock strategy, also checks that available resources exist with enough capacity for minimum occupancy.

Returns: Boolean

date

The calendar date for this availability entry.

Returns: Date — use with Liquid's date filter for display formatting.

initial_stock

Starting stock for this date, used to scale the "limited" availability signal to this day's own stock size.

Returns: Integer or nil — nil when the variant does not use inventory-per-night stock, or that stock is unlimited. Never leaks Float::INFINITY to templates.

initialize

any other checks

Returns: AvailabilityDayDrop — a new instance of AvailabilityDayDrop

limited

Whether stock is running low but not yet sold out. Convenience predicate over #availability_status.

Returns: Boolean

prices

Per-occupancy prices for this date in the current currency.

Returns: Array (VariantPriceDrop) — one entry per possible adult count on the variant.

{% assign price = day.prices | where: "occupancy", 2 | first %}
{{ price.fractional | money }}

remaining_stock

Remaining stock for this date when the variant uses an inventory-per-night stock strategy.

Returns: Integer or nil — nil when the variant does not use inventory-per-night stock, or that stock is unlimited; 0 for a default day with no override. Never leaks Float::INFINITY to templates.

On this page