code: protected Date getDateParam(String paramName, String errorMessage, Map<String, Object> mapToUse) throws IOException {
          String dateInString = getStringParam(paramName, errorMessage, mapToUse);
          if (dateInString == null) {
              if (errorMessage == null) {
                  return null;
              } else {
                  throw new IOException(errorMessage);
              }
          }
          try {
              DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
              return formatter.parse(dateInString);
          } catch (ParseException ignored) {
              DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
              try {
                  return formatter.parse(dateInString);
              } catch (ParseException e) {
                  if (errorMessage == null) {
                      return null;
                  } else {
                      throw new IOException(errorMessage, e);
                  }
              }
          }
      }
docs: Parses a date from either dd/MM/yyyy or yyyy-MM-dd format
  
  @param paramName    the name of the parameter containing the date
  @param errorMessage the message to put in an error if one occurs
  @param mapToUse     the external map that should be used as inputsource for parameters
  @return a date object correcponding with the jsonobject
  @throws IOException If something went wrong