findFirstDateOfTheWeek static method

DateTime findFirstDateOfTheWeek(
  1. DateTime dateTime
)

Find the first date of the week which contains the provided date.

Assume Monday is the first day of the week and Sunday is the last day of the week

Implementation

static DateTime findFirstDateOfTheWeek(DateTime dateTime) =>
    dateTime.subtract(Duration(days: dateTime.weekday - 1));