code fixes, added isSameOrAfter for DateTime objects, added check for teacher room and status

This commit is contained in:
2024-03-30 23:01:37 +01:00
parent 20d7b16ede
commit a0c025b58b
3 changed files with 48 additions and 12 deletions

View File

@ -16,4 +16,15 @@ extension IsSameDay on DateTime {
TimeOfDay toTimeOfDay() {
return TimeOfDay(hour: hour, minute: minute);
}
bool isSameDateTime(DateTime other) {
bool isSameDay = this.isSameDay(other);
bool isSameTimeOfDay = (toTimeOfDay() == other.toTimeOfDay());
return isSameDay && isSameTimeOfDay;
}
bool isSameOrAfter(DateTime other) {
return isSameDateTime(other) || isAfter(other);
}
}