generateWithDayStep static method
Returns an iterable of DateTime
with 1 day step in given range.
start
is the start of the range, inclusive.
end
is the end of the range, exclusive.
If start
equals end
, than start
still will be included in iterable.
If start
less than end
, than empty iterable will be returned.
DateTime
in result uses start
timezone.
Implementation
static Iterable<DateTime> generateWithDayStep(
DateTime start, DateTime end) sync* {
if (end.isBefore(start)) return;
var date = start;
do {
yield date;
date = nextDay(date);
} while (date.isBefore(end));
}