How To Get first day in a week?


Using how would I get the first day of a week when I click any date in that week in the Calendar control in

Convert this to VB:

[size=2]public DateTime GetStartOfWeek(DateTime date)
		case DayOfWeek.Monday:
			return date.AddDays(0);
		case DayOfWeek.Tuesday:
			return date.AddDays(-1);
		case DayOfWeek.Wednesday:
			return date.AddDays(-2);
		// etc ....


thank you

Or, conversely, you could do this:

Public Function GetStartOfWeek(ByRef XDate As DateTime) As DateTime

    Return XDate.AddDays(-XDate.DayOfWeek)

End Function

This works because the DayOfWeek.Sunday = 0, DayOfWeek.Monday = 1, etc.