Date Range Widget
This module offers a date field widget that allows for setting minimum and maximum date restrictions, including relative values like "today" or "in 5 days". It's useful for forms that need date validation, such as age verification or event registration, and includes customizable error messages.
Date Range Widget (drw) provides a simple date field widget with min/max validation and support for relative dates like "today" or "-18 years".
Perfect for age verification, event registration, appointment booking, and any form requiring date restrictions.
Key Features:
- Relative dates: Use
-18 years,today,+90 days, etc. - Easy configuration: Set restrictions directly in field widget settings: no code needed
- Custom error messages: Optional personalized validation messages with dynamic placeholders
Common Use Cases:
- Age verification: Min:
-18 years - Future dates only: Min:
today - Event period: Min:
2024-01-01, Max:2024-12-31 - Booking window: Min:
today, Max:+90 days
Quick Setup:
- Go to Manage form display for your content type
- Change date field widget to "Date Range Widget"
- Click ⚙️ to configure:
- Set min/max dates (absolute or relative)
- Check "Enable custom error messages" to personalize validation feedback
- Use
@minand@maxplaceholders in custom messages
Lightweight & Dependency-Free: No external dependencies, no JavaScript!
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Release Timeline
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 1.1.3 | Stable | 10–11 | Jan 31, 2026 | ||
| 1.1.2 | Stable | 10–11 | Dec 4, 2025 | ||
| 1.1.1 | Stable | 10–11 | Fix on relative dates formats parsing | Nov 24, 2025 | |
| 1.1.0 | Stable | 10–11 | Option to disable HTML5 validations and enable custom error messages | Nov 23, 2025 | |
| 1.0.3 | Stable | 10–11 | Apply constraints on all displays. | Nov 19, 2025 | |
| 1.0.2 | Stable | 10–11 | Translation support for errors messages. | Nov 18, 2025 | |
| 1.0.1 | Stable | 10–11 | Custom error message field for required date fields & improved dependency injection. | Nov 17, 2025 | |
| 1.0.0 | Stable | 10–11 | Field widget to validate date ranges with absolute and relative formats. | Nov 15, 2025 |