weeks property

Iterable<Timespan> get weeks

get all weeks that overlap with a the Timespan

Implementation

Iterable<Timespan> get weeks sync* {
  DateTime tempTime = begin.beginOfWeek();
  final week = const Duration(days: 7) - const Duration(hours: 1);
  while (tempTime.isBefore(end)) {
    yield Timespan(begin: tempTime, duration: week);
    tempTime = tempTime.add(week);
  }
}