previous method
Returns the previous LocalDateTime falling on the specified DayOfWeek, at the same time of day as this value. This is a strict 'previous' - if this value on already falls on the target day of the week, the returned value will be a week earlier.
targetDayOfWeek
: The ISO day of the week to return the previous date of.
Returns: The previous LocalDateTime falling on the specified day of the week.
InvalidOperationException
: The underlying calendar doesn't use ISO days of the week.ArgumentOutOfRangeException
:targetDayOfWeek
is not a valid day of the week (Monday to Sunday).
Implementation
LocalDateTime previous(DayOfWeek targetDayOfWeek) => LocalDateTime.localDateAtTime(calendarDate.previous(targetDayOfWeek), clockTime);