getLastDayOfWeek method

DateTime getLastDayOfWeek(
  1. {int weekStartDay = 0}
)

Gets last day of week.

  • weekStartDay is 0 indexed where Sunday is 0 and Saturday is 6 Defaults to 0.

Implementation

DateTime getLastDayOfWeek({int weekStartDay = 0}) {
  final DateTime first = getFirstDayOfWeek(weekStartDay: weekStartDay);
  return DateTime(
    first.year,
    first.month,
    first.day + 6,
    first.hour,
    first.minute,
    first.second,
  );
}