Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.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
Project information
- Project categories: Site structure
4,122 sites report using this module
- Created by larowlan on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
The one where griz improved the default behaviour 🚀
Development version: 8.x-1.x-dev updated 1 Apr 2025 at 21:35 UTC





