DateRange
A simple date range
Source
public static class ext
{
public static IEnumerable<DateTime> GetDateRangeTo(this DateTime self, DateTime toDate)
{
var range = Enumerable.Range(0,new TimeSpan(toDate.Ticks - self.Ticks).Days);
return from p in range
select self.Date.AddDays(p);
}
}
Example
// Get next 80 days
IEnumerable<DateTime> dateRange = DateTime.Now.GetDateRangeTo(DateTime.Now.AddDays(80));