next method

  1. @override
DateTime next(
  1. DateTime date, {
  2. DateTime? limit,
})
override

Returns the next instance of the given date considering this Every base process.

For every one one of the everies that is a LimitedEvery, the limit will be passed. If none of the everies is a LimitedEvery, the limit will be ignored.

Implementation

@override
DateTime next(DateTime date, {DateTime? limit}) {
  if (isEmpty) return date;
  final nextDates =
      map((every) => LimitedOrEveryHandler.next(every, date, limit: limit));
  return nextDates.reduce(DateReducer.reduceFuture);
}