Year views filter option
Year views filter result
year_filter_config
year_filter_bootstrap_datepicker

This module add the possibility to expose date/date time filter with year (format CCYY) instead of using full date (format CCYY-MM-DD HH:MM:SS) or offset from the current time.

This module support Bootstrap Datepicker library

Configuration

This module has only one setting if you want to display your exposed filter with Bootstrap Datepicker library go to /admin/config/views-year-filter/settings check Use Bootstrap Datepicker, SAVE and Clear cache.

you will have Datepicker popup with only years as it shown in the last screenShot.

Note: This module support the following operators

  1. Less than
  2. Less than or equal to
  3. Equal to
  4. Not equal to
  5. Greater than or equal to
  6. Greater than
  7. Between

⚠️ Warning

This module conflicts with the Smart Date module because both implement hook_views_plugins_filter_alter.
If Smart Date is enabled, you must use its date filter with year granularity instead of the filter provided by this module.

As a result, when Smart Date is enabled, the date filter from this module will not appear as an option for your date fields.

Note: This applies only to Date-only fields, not DateTime fields or Search API date fields.

Supporting organizations: 

Project information

Releases