getWeekDay static method

int getWeekDay(
  1. DateTime _date,
  2. bool startWeekWithSunday
)

Implementation

static int getWeekDay(DateTime _date, bool startWeekWithSunday) {
  if (startWeekWithSunday) {
    return _date.weekday == DateTime.sunday ? 1 : _date.weekday + 1;
  } else {
    return _date.weekday;
  }
}