moveToFirstWeekday static method
Returns the first date of the week containing date
.
Implementation
static DateTime moveToFirstWeekday(DateTime date) {
if (date.weekday == DateTime.sunday) {
return date;
}
return date.add(Duration(days: -date.weekday));
}