code: private void parseDateParam(Map<String, Integer> params, Object value) {
      if (value instanceof Number) {
        int n = ((Number) value).intValue();
        if (n <= 31) {
          // Its a day
          if (params.get("day1") == null) {
            params.put("day1", n);
          } else {
            params.put("day2", n);
          }
        } else {
          // Its a year
          if (params.get("year1") == null) {
            params.put("year1", n);
          } else {
            params.put("year2", n);
          }
        }
      }
  
      if (value instanceof String) {
        int n = MONTH.indexOf(((String) value).toUpperCase(Locale.ENGLISH));
        if (n > -1) {
          // Its a month
          if (params.get("month1") == null) {
            params.put("month1", n);
          } else {
            params.put("month2", n);
          }
        }
      }
  
      if (GMT.equalsIgnoreCase(String.valueOf(value))) {
        params.put("gmt", 1);
      }
    }
docs: ***********************************************************************
  Try to guess the type of the given parameter and put it into the params
  map.
  
  @param params
  a map to put the parsed parameters into.
  @param value
  to parse and specify the type for.
  **********************************************************************