If you have a collection of "Items" with a DateTime
property and you want to count all of this week, this should work:
var calendar = DateTimeFormatInfo.CurrentInfo.Calendar;
var weekRule = DateTimeFormatInfo.CurrentInfo.CalendarWeekRule;
var firstDay = DateTimeFormatInfo.CurrentInfo.FirstDayOfWeek;
int week = calendar.GetWeekOfYear(DateTime.Today, weekRule, firstDay);
int thisWeekBookings = items
.Count(i => i.DateTimeScheduled.Year == DateTime.Today.Year &&
week == calendar.GetWeekOfYear(i.DateTimeScheduled, weekRule, firstDay));