I have an IEnumerable<DateTime>
. I would like to pull out all dates that occur in the current calendar month even if they have passed as well as all dates in the next 11 calendar months. I'll be displaying the dates grouped by month starting with the most recent. For example:
Current Date - Mar 12 2012
- March 2012
- March 3 - Event 1
- March 15 - Event 2
- March 30 - Event 3
- ...
- ...
- ...
- February 2013
- Feb 3 - Event 156
- Feb 13 - Event 157
- Feb 20 - Event 158
I already know how to do the grouping part. How would you accomplish filtering the dates using linq and C#?