This project is not covered by Drupal’s security advisory policy.

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:

  1. Go to Manage form display for your content type
  2. Change date field widget to "Date Range Widget"
  3. Click ⚙️ to configure:
    • Set min/max dates (absolute or relative)
    • Check "Enable custom error messages" to personalize validation feedback
    • Use @min and @max placeholders in custom messages

Lightweight & Dependency-Free: No external dependencies, no JavaScript!

Project information

Releases