Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Date Range Availability

No security coverage Maintenance fixes only 3 sites

This module allows you to manage and display the availability of entities based on defined date ranges. It supports various states like "Available" or "Unavailable" and can be integrated into Views or displayed directly in theme templates. This is useful for applications like event management, e-commerce, or booking systems.

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.

Drupal 9–11

Ask your assistant about Date Range Availability

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • datetime_range Drupal core
  • views Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Jan 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 3
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
1.0.1 Stable 9–11 Jan 22, 2025
1.0.0 Stable 9–11 Jan 19, 2025
1.0.x-dev Dev 9–11 Jan 19, 2025