public static LocalDate adjustToLastDayOfWeek ( LocalDate date , DayOfWeek firstDayOfWeek ) { LocalDate startOfWeek = adjustToFirstDayOfWeek ( date , firstDayOfWeek ) ; return startOfWeek . plusDays ( 6 ) ; }
Adjusts the given date to a new date that marks the end of the week where the given date is located . If Monday is the first day of the week and the given date is a Wednesday then this method will return a date that is four days later than the given date . This method calculates the first day of the week and then adds six days to it .