Skip to content

Instantly share code, notes, and snippets.

@jasmin-mistry
Created January 28, 2014 13:07
Show Gist options
  • Save jasmin-mistry/8667287 to your computer and use it in GitHub Desktop.
Save jasmin-mistry/8667287 to your computer and use it in GitHub Desktop.
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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment