Пример #1
0
  public JwDate parse(String s) {
    int[] arr = _parser.getFields(s);
    if (arr.length != 3) return null;

    Integer yy = _parser.coerceYear(arr[0]);
    Integer mm = arr[1];
    Integer dd = arr[2];
    if (!JwDateUtility.isValid(yy, mm, dd)) return null;
    return new JwDate(yy, mm, dd);
  }
Пример #2
0
 public JwDatePolicyIso() {
   _formatter = new JwDateFormatter(FORMAT);
   _parser = new JwDateParser();
   _parser.setSeparator('-');
   _monthYearPolicy = new JwMonthYearPolicyIso();
 }