-
-
Save TheDahv/1946234 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var groupedByWeek = new List<DateTime> { | |
new DateTime(2012, 02, 01), | |
new DateTime(2012, 02, 02), | |
new DateTime(2012, 02, 06), | |
new DateTime(2012, 02, 13) | |
}. | |
GroupBy(s => s.DayOfYear / 7). | |
ToDictionary( | |
s => (new DateTime(2012, 01, 01).AddDays((s.First().DayOfYear / 7) * 7)), | |
s => s.Count() | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment