simplify: dedupe boilerplate and remove dead code across all layers
This commit is contained in:
@@ -13,12 +13,8 @@ extension IsSameDay on DateTime {
|
||||
|
||||
TimeOfDay toTimeOfDay() => TimeOfDay(hour: hour, minute: minute);
|
||||
|
||||
bool isSameDateTime(DateTime other) {
|
||||
var isSameDay = this.isSameDay(other);
|
||||
var isSameTimeOfDay = (toTimeOfDay() == other.toTimeOfDay());
|
||||
|
||||
return isSameDay && isSameTimeOfDay;
|
||||
}
|
||||
bool isSameDateTime(DateTime other) =>
|
||||
isSameDay(other) && toTimeOfDay() == other.toTimeOfDay();
|
||||
|
||||
bool isSameOrAfter(DateTime other) => isSameDateTime(other) || isAfter(other);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user