fix: use isBefore method rather than the compare for readability (and fix a bug)

This commit is contained in:
Joey Boerwinkel 2024-07-26 11:44:45 +02:00 committed by FlutterJoey
parent 7204f77d05
commit 5b251d9ba7

View file

@ -94,7 +94,7 @@ class AvailabilityModel {
/// Verify the validity of this availability /// Verify the validity of this availability
void validate() { void validate() {
if (startDate.compareTo(endDate) < 0) { if (!startDate.isBefore(endDate)) {
throw AvailabilityEndBeforeStartException(); throw AvailabilityEndBeforeStartException();
} }