Given a date range, I need to know how many Mondays (or Tuesdays, Wednesdays, etc) are in that range.
I am currently working in C#.
I've come across a slightly easier way to solve this problem using linq.
public static int NumberOfFridays(DateTime start, DateTime end) { return start.GetDaysInBetween(end, inclusive: true).Count(d => d.DayOfWeek == DayOfWeek.Friday); }
Hope that helps.