This function identifies the first day of week based on a particular date.
Sending 01.01.2010 will return 28.12.2009.
M | T | W | T | F | S | S
28 29 30 31 1 2 3
First date in same week as 01.01.2010 date, is 28.12.2009.
Private Function FirstDateOfWeek(ByVal dayInWeek As Date) As Date
Dim Days As Integer = dayInWeek.DayOfWeek - CurrentCulture.DateTimeFormat.FirstDayOfWeek
Days = (7 + Days) Mod 7