Group by date with Views in Drupal 7

By xngo on February 23, 2019

Let's assume that you want to group all your nodes by month. Do the followings:

  1. At admin/config/regional/date-time/formats/add, create a year-month format(e.g. Y-m).
  2. At admin/config/regional/date-time/types/add, create a year-month date type and link to your year-month format.
  3. Go to your View and open your date field. Select the year-month date type you created.
  4. Go to Format->Settings, set Grouping field Nr.1 to your date field.

Note: If RDF module is enabled, then check Remove tags from rendered output at Format->Settings. Otherwise, the grouping will not work.

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.