From b3a917769ded97d326cb85fb1792f3e7a4494351 Mon Sep 17 00:00:00 2001 From: Freek van de Ven Date: Fri, 26 Jul 2024 16:00:07 +0200 Subject: [PATCH] fix: change template deviation logic for when a day is missing from a template If a day is missing the availability automatically deviates --- .../lib/src/models/templates.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/flutter_availability_data_interface/lib/src/models/templates.dart b/packages/flutter_availability_data_interface/lib/src/models/templates.dart index f782049..4cf9642 100644 --- a/packages/flutter_availability_data_interface/lib/src/models/templates.dart +++ b/packages/flutter_availability_data_interface/lib/src/models/templates.dart @@ -315,7 +315,8 @@ class WeekTemplateData implements TemplateData { var dayOfWeek = WeekDay.values[availability.startDate.weekday]; var data = _data[dayOfWeek]; if (data == null) { - return false; + // if the day of the week is not in the template, it deviates + return true; } // compare the start and end with the template return !start.timeMatches(data.startTime) || !end.timeMatches(data.endTime);