public static DateTime GetFirstDayOfWeek(this DateTime date)
{
var dfi = DateTimeFormatInfo.CurrentInfo;
var firstDayOfWeek = date;
while (firstDayOfWeek.DayOfWeek != dfi.FirstDayOfWeek)
firstDayOfWeek= firstDayOfWeek.AddDays(-1);
return firstDayOfWeek;
}