code fixes, added isSameOrAfter for DateTime objects, added check for teacher room and status
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user