I have a list of items. Each item contains a date
property.
I want to group all items by month and display them in two nested lists.
Example
June 2015
- Item 1
- Item 2
- Item 3
May 2015
- Item 4
- Item 5
- Item 6
etc.
Is it possible to achieve this in Angular.js without fiddling with underlying data (i.e. via filters and such)?
I've tried the method described in this topic:
How can I group data with an Angular filter?, but it breaks the order of the elements and I have to manually format date to 'MMMM YYYY'
before calling groupBy
.