hours method

Iterable<DateTime> hours()

Generates an iterable of DateTime objects representing each hour within the date range.

Implementation

Iterable<DateTime> hours() sync* {
  var i = startDate;
  while (i.isBefore(endDate)) {
    yield i;
    i = i.add(const Duration(hours: 1));
  }
}