Search code examples
datedrupalfilterdrupal-8datefilter

D8 - How to filter months and year in View page


In D7, date field and authoring date can filter by months and year, even days, in 'Filter Criteria'. But in D8, this function seems abolish in 'Filter Criteria'. I keep looking for module that can filter months and years. Group filters obviously isn't a good way to solve this problem.

Anyway, my question is, how to filter days and months programmatically ? In theme_hook, write a module, whatever it's work. Because this filtering function is quite important for me. Thanks.


Solution

  • This comes under Contextual Filters now. But you still might need to do some little coding if you want to expose this filter, see https://www.flocondetoile.fr/blog/filter-content-year-views-drupal-8.

    Contextual Filters