fix: change template deviation logic for when a day is missing from a template

If a day is missing the availability automatically deviates
This commit is contained in:
Freek van de Ven 2024-07-26 16:00:07 +02:00 committed by Freek van de Ven
parent 0852b25678
commit b3a917769d

View file

@ -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);