lastWeekdayInMonth method

Hora lastWeekdayInMonth(
  1. int weekday
)

Gets the last occurrence of a weekday in the current month.

Implementation

Hora lastWeekdayInMonth(int weekday) {
  var current = endOf(TemporalUnit.month);
  while (current.weekday != weekday) {
    current = current.subtract(1, TemporalUnit.day);
  }
  return current;
}