buildDateRange function
Implementation
List<DateTime> buildDateRange(DateTime start, DateTime end, bool include) {
DateTime firstDate = DateTime(start.year, start.month, start.day, 0, 0, 0);
int dayDiff = computeDayDiff(start, end);
List<DateTime> array = [];
if (include) {
array.add(firstDate);
}
for (int i = 1; i < dayDiff; i += 1) {
DateTime tempDate = firstDate.add(Duration(days: i));
array.add(tempDate);
}
if (include) {
array.add(DateTime(end.year, end.month, end.day, 0, 0, 0));
}
return array;
}