code: def calculate_date_strings(self, mode, numDays):
          
  
          yesterday = date.today() - timedelta(days=1)
          endday = datetime(yesterday.year, yesterday.month, yesterday.day, 23, 59, 59, 999)
          if mode:
              startday = yesterday - timedelta(days=numDays)
          else:
              # daily mode
              startday = yesterday
  
          return startday.isoformat(), endday.strftime('%Y-%m-%d %H:%M:%S.%f')
docs: Returns a tuple of start (in YYYY-MM-DD format) and end date
             strings (in YYYY-MM-DD HH:MM:SS format for an inclusive day).