isLastDayOfWeek static method
Checks if day
is in the last day of a week.
You can define first weekday (Monday, Sunday or Saturday) with
parameter firstWeekday
. It should be one of the constant values
DateTime.monday, ..., DateTime.sunday.
By default it's DateTime.monday, so the last day will be DateTime.sunday.
Implementation
static bool isLastDayOfWeek(DateTime day, {int? firstWeekday}) {
assert(firstWeekday == null || firstWeekday > 0 && firstWeekday < 8);
return isSameDay(lastDayOfWeek(day, firstWeekday: firstWeekday), day);
}