I have a list of dates and I want to group by items that are consecutive days
so if in the list I have the following dates:
Dec 31, 2013
Jan 1, 2014
Jan 2, 2014
Feb 1, 2014
Feb 2, 2014
Feb 16, 2014
Mar 13, 2014
I want to come up with a way to group this so I get:
Group 1:
Dec 31, 2013
Jan 1, 2014
Jan 2, 2014
Group 2:
Feb 1, 2014
Feb 2, 2014
Group 3:
Feb 16, 2014
Group 4: Mar 13, 2014
as you can see, the grouping is based on items that are consecutive days.
What is the best way in C#, to take this list and transform them into these groups?