DateInterval constructor
DateInterval({})
Creates an instance of the DateInterval class.
period
must be greater than 0 or it will throw an ArgumentError.
Implementation
DateInterval({
DateTime? startDate,
DateTime? endDate,
this.period = 1,
this.interval = Intervals.once,
Iterable<DateTime>? skipDates,
}) {
if (period < 1) {
throw ArgumentError.value(
period, 'period', 'Period must be 1 or greater.');
}
if (skipDates != null) {
this.skipDates.addAll(skipDates);
}
this.startDate = startDate == null
? DateTime.now().withZeroTime()
: startDate.withZeroTime();
this.endDate = endDate?.withZeroTime();
}