docs: def format_date_argument(date_element):
      """
      Take a date as either a datetime.date/datetime or a string and return it as a iso8601 formatted value
      :param Union[datetime.date, datetime.datetime] date_element: passed argument
      :rtype str
      :return:
      """
      if not isinstance(date_element, (datetime.datetime, datetime.date)):
          # TODO:
          if "T" in date_element:
              _date = datetime.datetime.strptime(date_element, "%Y-%m-%dT%H:%M:%S")
          else:
              _date = datetime.datetime.strptime(date_element, "%Y-%m-%d").date()
      else:
          _date = date_element
      return _date.isoformat()