Drupal is a registered trademark of Dries Buytaert

The Date Range Availability module allows you to manage and display availability for entities (e.g., events, products, resources) based on date ranges. It provides a simple way to define and show availability states (e.g., Available, Unavailable, Coming Soon) directly within theme templates or as a global field in Views. This module is ideal for event management, e-commerce, booking systems, and more.

Features

Define Availability: Set availability states based on date ranges.
Multiple States: Supports states like Available, Unavailable, and Coming Soon.
Views Integration: Add an Availability field to Views to display the entity's current state.
Custom Theming: Use the node_availability Twig function to display availability in templates.
Flexible Use Cases: Perfect for event management, e-commerce, booking systems, and more.

Installation and Usage

1. Install the Module
Download and enable the Date Range Availability module.
2. Use in Theming
To display the availability state in your theme templates, use the node_availability() function. This function accepts two parameters:
Node: A variable node that holds node object in twig.
Date Range Field: The machine name of the date range field.
Example:

{% set state = node_availability(node, 'field_date') %}
<p class="availability {{ state.label_class }}">{{ state.label }} </p>

3. Use in Views
To show the availability state in Views:
Add the Availability field to your View.
Configure the field by specifying the machine name of the date range field (e.g., field_date).
The availability state will be displayed for each row in the View.

Activity

Total releases
3
First release
Jan 2025
Latest release
1 year ago
Release cadence
1 day
Stability
67% stable

Release Timeline

Releases

Version Type Release date
1.0.1 Stable Jan 22, 2025
1.0.0 Stable Jan 19, 2025
1.0.x-dev Dev Jan 19, 2025