startOfLocalWeek method
Returns start of the week based on weekStart
. If it's null, it uses Moment.defaultLocalization.weekStart
Returned object will have same timezone as this
Implementation
DateTime startOfLocalWeek([int? weekStart]) {
weekStart ??= Moment.defaultLocalization.weekStart;
int delta = weekday - weekStart;
if (delta < 0) {
delta += 7;
}
return subtract(Duration(days: delta)).startOfDay();
}