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). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Interval Field

4,390 sites Security covered Drupal 10–11
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

Depends on

Dependencies of the latest stable release

  • field Drupal core

Required by

2 tracked projects depend on this one

Activity

Tracked releases
3
Tracked since
Apr 2025
Latest release
1 month ago
Releases (12 mo)
2 ▲ from 1
Maintenance
Active

Release Timeline

Releases

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