findFirstDateOfPreviousWeek static method

DateTime findFirstDateOfPreviousWeek(
  1. DateTime dateTime
)

Find first date of previous week using a date in current week. dateTime A date in current week.

Implementation

static DateTime findFirstDateOfPreviousWeek(DateTime dateTime) {
  final DateTime sameWeekDayOfLastWeek =
      dateTime.subtract(const Duration(days: 7));
  return findFirstDateOfTheWeek(sameWeekDayOfLastWeek);
}