docs: private Optional<Interval> parseValueAsInterval(Symbol valSym) {
      String val = valSym.asString();
  
      //first see if time of day is fuzzy (TMO, TNI, TXX etc.), and if so, get rid of that
      String timePart = "";
      if (val.contains("T")) {
        timePart = val.substring(val.indexOf("T") + 1);
        if (timePart.contains("X") || nonISOMarkersPattern.matcher(timePart).find()) {
          timePart = "";
        }
        val = val.substring(0, val.indexOf("T"));
      }
      val = val + (!timePart.equals("") ? "T" + timePart : "");
  
      //now get rid of unspecified markers (X) or weekend, season, FY etc. markers.
      //Timex2 standard says that it extends ISO 8601 for vals which means basic ISO 8601 format
      //may also be allowed. All the examples that I have seen have always had hyphens tho.
      //Therefore, for simplicity, we will split val on hyphens ~msrivast
      String[] valParts = val.split("-");
      ImmutableList.Builder<String> specificValParts = ImmutableList.builder();
      for (int i = 0; i < valParts.length; i++) {
        String part = valParts[i];
        //if part contains X or is a season, fiscal year, periods of day marker etc. break, since the
        //timex value can be specific only upto here
        if (part.contains("X") || nonISOMarkers.contains(Symbol.from(part))) {
          break;
        }
        specificValParts.add(part);
      }
      val = Joiner.on("-").join(specificValParts.build());
  
      // it could be a simple date which we can extract
      // directly (very common; needs to come after the above because
      // its regex will match week-based dates, too)
      try {
        return Optional.of(ISODateTimeFormat.yearMonthDay().parseDateTime(val).dayOfMonth()
            .toInterval());
      } catch (final IllegalArgumentException iae) {
        // pass
      }
  
      // could be YYYY-MM type date
      try {
        return Optional.of(ISODateTimeFormat.yearMonth()
            .parseDateTime(val).monthOfYear().toInterval());
      } catch (final IllegalArgumentException iae) {
        // pass
      }
  
      // could be a YYYY type date
      try {
        return Optional.of(ISODateTimeFormat.year()
            .parseDateTime(val).year().toInterval());
      } catch (final IllegalArgumentException iae) {
        // pass
      }
  
      // it could be a 2014-W3-01 style week-based date
      try {
        return Optional.of(ISODateTimeFormat.weekyearWeekDay()
            .parseDateTime(val).dayOfMonth().toInterval());
      } catch (final IllegalArgumentException iae) {
        // it's okay if it's unparseable; just wasn't in this format
      }
  
      // it would be a 2014-W3 style week-based date
      try {
        return Optional.of(ISODateTimeFormat.weekyearWeek()
            .parseDateTime(val).weekOfWeekyear().toInterval());
      } catch (final IllegalArgumentException iae) {
        // it's okay if it's unparseable; just wasn't in this format
      }
  
      // this needs to go last or it would short-circuit the week
      // formats
      try {
        return Optional.of(ISODateTimeFormat.dateTimeParser()
            .parseDateTime(val).minuteOfDay().toInterval());
      } catch (final IllegalArgumentException iae) {
        // pass
      }
  
      // value was not parseable as a joda time Interval--see if the first one, two or three
      // characters of val
      // are digits, which would address the cases like 1,19,199
      String digits = "";
      for (int i = 0; i < 3 && i < val.length() && Character.isDigit(val.charAt(i)); i++) {
        digits += val.substring(i, i + 1);
      }
      if (!digits.equals("")) {
        int period = (int) Math.pow(10, 4 - digits.length());
        int startYear = Integer.parseInt(digits) * period;
        int endYear = startYear + period;
        return Optional.of(Interval.parse(startYear + "/" + endYear));
      }
  
      log.warn("Value not parseable as interval: {}", val);
  
      return Optional.absent();
    }