timetable performance optimization
This commit is contained in:
@@ -36,6 +36,11 @@ extension CalendarDayArithmetic on DateTime {
|
||||
);
|
||||
|
||||
DateTime subtractDays(int days) => addDays(-days);
|
||||
|
||||
DateTime get dateOnly => DateTime(year, month, day);
|
||||
|
||||
/// Monday 00:00 of this date's week.
|
||||
DateTime get mondayOfWeek => subtractDays(weekday - 1).dateOnly;
|
||||
}
|
||||
|
||||
/// Formatting helpers backed by Jiffy. Centralises the patterns that previously
|
||||
|
||||
Reference in New Issue
Block a user