Limit timetable scrolling so no errors occur

This commit is contained in:
2023-06-19 18:10:42 +02:00
parent f51e3cd216
commit 7dde66b89c
3 changed files with 26 additions and 1 deletions

View File

@ -105,4 +105,17 @@ class TimetableProps extends DataHolder {
notifyListeners();
}
}
void resetWeek() {
error = null;
notifyListeners();
DateTime queryWeek = DateTime.now().add(const Duration(days: 2));
startDate = getDate(queryWeek.subtract(Duration(days: queryWeek.weekday - 1)));
endDate = getDate(queryWeek.add(Duration(days: DateTime.daysPerWeek - queryWeek.weekday)));
run();
notifyListeners();
}
}