getDateTimeThisWeek function
Returns start and end of this week using time
as reference.
time
if null uses DateTime.now .
Implementation
Pair<DateTime> getDateTimeThisWeek(
[DateTimeWeekDay? weekFirstDay, DateTime? now]) {
now ??= DateTime.now();
var weekStart = getDateTimeWeekStart(weekFirstDay, now);
var weekEnd = getDateTimeWeekEnd(weekFirstDay, now);
return Pair(getDateTimeDayStart(weekStart), getDateTimeDayEnd(weekEnd));
}