timetable performance optimization
This commit is contained in:
1 parent
ef7d17033d
commit
ed8e52f475
13 files changed
+391
-137
No files matched your search
@@ -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