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). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). 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.

Interval Field

4,224 sites Security covered
View on drupal.org

This module provides a field and widget for users to input interval values, such as "2 months" or "3 days." It comes with common interval periods and allows for easy extension with custom intervals.

Overview

Interval field gives you a simple field and widget to allow users to enter interval values eg

  • 2 months
  • 3 days
  • 4 years

Features

The field comes pre-bundled with one simple formatter and second, minute, hour, day, week, fortnight, month, quarter and year interval periods.
The available periods can be easily extended by other modules (see interval.api.php in 7.x for info).
In 8.x add new intervals using a file in your module called {$module}.intervals.yml with contents like so:

second:
  plural: Seconds
  singular: Second
  php: seconds
  multiplier: 1

See interval.intervals.yml for an example.

Requirements

7.x

  • Core field module (obviously).
  • Date API (submodule of date).

8.x

No non-core modules required.

Road Map

At present the module only has a basic formatter but the api is there to support more flexible displays such as relative to the current date/time or an arbitrary date.

Credits

Module by larowlan of Rowlands Group.

Sponsored by Choc-Chip Media.

News

I did a session on fields, widgets and formatters at Drupal downunder 2012 - during which I discussed how this module works as an example of the field api. If you're interested you can view the presentation.

Complimentary Modules

Activity

Total releases
3
First release
Apr 2025
Latest release
5 days ago
Releases (12 mo)
2 ▲ from 1
Maintenance
Active

Release Timeline

Releases

Version Type Release date
8.x-1.17 Stable Jul 12, 2026
8.x-1.16 Stable Jul 6, 2026
8.x-1.15 Stable Apr 1, 2025