Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Date Range Availability

3 sites No security coverage
View on drupal.org

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.

Activity

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

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