includes method
Determines if the targetDate
falls along the configured interval.
Implementation
bool includes(DateTime targetDate) {
if (targetDate.isBefore(startDate) ||
_isSkipDate(targetDate) ||
_isAfterEndDate(targetDate)) {
return false;
}
switch (interval) {
case Intervals.once:
return targetDate.isSameDayAs(startDate);
case Intervals.daily:
return targetDate.isOnDailyIntervalFrom(startDate, period);
case Intervals.weekly:
return targetDate.isOnWeeklyIntervalFrom(startDate, period);
case Intervals.monthly:
return targetDate.isOnMonthlyIntervalFrom(
startDate,
period,
additionalDates,
);
case Intervals.yearly:
return targetDate.isOnYearlyIntervalFrom(startDate, period);
}
}