1
0
forked from firka/firka

fix lesson index

This commit is contained in:
2025-07-23 14:08:48 +02:00
parent a32abdb879
commit fb39b2e34a

View File

@@ -173,14 +173,7 @@ extension DateGrouper<T> on Iterable<T> {
extension LessonExtension on List<Lesson> {
int getLessonNo(Lesson lesson) {
var midnight = first.start.getMidnight();
int i = indexOf(lesson);
if (!first.start.isBefore(midnight.add(Duration(hours: 8)))) {
i++;
}
return i;
return lesson.lessonNumber ?? indexOf(lesson);
}
Lesson? getCurrentLesson(DateTime now) {