mirror of
https://github.com/Iconica-Development/flutter_availability.git
synced 2025-05-19 05:03:44 +02:00
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:
parent
0852b25678
commit
b3a917769d
1 changed files with 2 additions and 1 deletions
|
@ -315,7 +315,8 @@ class WeekTemplateData implements TemplateData {
|
||||||
var dayOfWeek = WeekDay.values[availability.startDate.weekday];
|
var dayOfWeek = WeekDay.values[availability.startDate.weekday];
|
||||||
var data = _data[dayOfWeek];
|
var data = _data[dayOfWeek];
|
||||||
if (data == null) {
|
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
|
// compare the start and end with the template
|
||||||
return !start.timeMatches(data.startTime) || !end.timeMatches(data.endTime);
|
return !start.timeMatches(data.startTime) || !end.timeMatches(data.endTime);
|
||||||
|
|
Loading…
Reference in a new issue