lastOccurrenceOfDayInMonth

lastOccurrenceOfDayInMonth(dayOfWeek: Integer): Date;

The lastOccurrenceOfDayInMonth method of the Date primitive type returns the date identical to the receiver except that the day is modified to the last occurrence that matches the day specified in the dayOfWeek parameter.

The Integer values and the days that they represent are listed in the following table.

Integer Value Corresponding Day
1 Monday
2 Tuesday
3 Wednesday
4 Thursday
5 Friday
6 Saturday
7 Sunday

2020.0.01 and higher