The Year module provides a custom field type that allows users to input only the year. It includes different input widgets and offers flexibility in setting minimum, maximum, and default year values. A sub-module also adds a user-friendly dropdown filter for views.
Year provides a custom, integer-based field to capture only the year part of a date.
⚠️ Future Deprecation
Year is still fully supported, but will someday be deprecated (with migration path) in favor of Year Only.
See #3381046: Eventual Deprecation in favor of Year Only for details and updates.
Features
- Two included widgets: text field and select list (with sort option).
- Flexible min, max and default values. Set field constraints and default value using explicit numbers, or relative date strings ('+5 years', 'now', etc.).
- Dropdown year filter. Enable the year_views sub-module for a custom 'dropdown' views filter with a configurable range of years for more user-friendly exposed filters.
- Support for Feeds.
Ask your assistant about Year
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
- field Drupal core
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.