Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Date Range Availability

3 sites No security coverage Drupal 9–11
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.

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 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