getDateTimeLastNDays function
Returns start and end of last nDays counting from time.
time if null uses  DateTime.now .
Implementation
Pair<DateTime> getDateTimeLastNDays(int nDays, [DateTime? time]) {
  time ??= DateTime.now();
  return Pair(getDateTimeDayStart(time.subtract(Duration(days: nDays))),
      getDateTimeDayEnd(time));
}