I'm finding a lot of resources for 7 but not much for Drupal 8.

I'm displaying a content type with a date field in a view. I'd like a dropdown that presents users with a list of years for filtering purposes.

When I add that field as a filter I'm presented with two options:

  1. A text input date, preferably in machine-readable format
  2. An offset from the current date, also text input

Neither of these are very useful in an exposed filter. Is there a way I can filter only on the year using a dropdown?


Perhaps not the most elegant, but I used the following on the date field:

Views date field filter settings

  • This solution requires manually adding a year grouping when a new one rolls around, correct? – user1359 May 3 '19 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.