I'm trying to get the date of the monday in the current week. Is this close to correct?
Dim MondayOfCurrentWeek As Date = Date.Today - Date.Today.DayOfWeek + 1
As far as I understand it the AyOfWeek indexes are:
1 = Monday
2 = Tuesday
3 = Wednesday
4 = Thursday
5 = Friday
6 = Saturday
0 = Sunday
Hence if for example Date Today is a thursday I would get:
Dim MondayOfCurrentWeek As Date = Date - 4 + 1
which would be equal to
Date - 3
and seems right to me.
Or am I totally off?