I want so sort a news list by year and month, e.g.
January 2014:
item 1
Item 2
February 2014
item 3
item 4
I'm struggling to do this in Razor using GroupBy:
I can group items by year:
var yearGroups = newsOverview.Descendants("duhubCalendarItem").OrderBy("date desc").GroupBy("date.Year");
But I need to group them by year and month. Is it possible to have nested groups? Or specify year and month in the groupBy clause?
Thanks
Dan
This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/47243-using-groupby-to-sort-a-list-by-year-and-month