firstDayOfWeek method
Implementation
DayDart firstDayOfWeek([Object? date]) {
/// Handle Daylight Savings by setting hour to 12:00 Noon
/// rather than the default of Midnight
DayDart d = clone(date)..hour(12);
/// Weekday is on a 1-7 scale Monday - Sunday,
/// This Calendar works from Sunday - Monday
var decreaseNum = d.week() % 7;
if (decreaseNum == 0) {
decreaseNum = 7;
}
return d.subtract(decreaseNum, DayUnits.D);
}