public static DateTime FirstDayOfWeek(DateTime date)
{
DayOfWeek fdow = CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek;
int offset = fdow - date.DayOfWeek;
DateTime fdowDate = date.AddDays(offset);
return fdowDate;
}
public static DateTime LastDayOfWeek(DateTime date)
{
DateTime ldowDate = FirstDayOfWeek(date).AddDays(6);
return ldowDate;
}