@Test public void alpha() { CSLDateParser parser = new CSLDateParser(); CSLDate date = parser.parse("November 2013"); assertArrayEquals(new int[][] { new int[] { 2013, 11 } }, date.getDateParts()); }
public CSLDate parse(String str) { Map<String, Object> res; try { @SuppressWarnings("unchecked") Map<String, Object> m = runner.callMethod( parser, "parseDateToArray", Map.class, str); res = m; } catch (ScriptRunnerException e) { throw new IllegalArgumentException("Could not update items", e); } CSLDate r = CSLDate.fromJson(res); if (r.getDateParts().length == 2 && Arrays.equals(r.getDateParts()[0], r.getDateParts()[1])) { r = new CSLDateBuilder(r).dateParts(r.getDateParts()[0]).build(); } return r; }
CSLDateParser { public CSLDate parse(String str) { Map<String, Object> res; try { @SuppressWarnings("unchecked") Map<String, Object> m = runner.callMethod( parser, "parseDateToArray", Map.class, str); res = m; } catch (ScriptRunnerException e) { throw new IllegalArgumentException("Could not update items", e); } CSLDate r = CSLDate.fromJson(res); if (r.getDateParts().length == 2 && Arrays.equals(r.getDateParts()[0], r.getDateParts()[1])) { r = new CSLDateBuilder(r).dateParts(r.getDateParts()[0]).build(); } return r; } }
CSLDateParser { public CSLDate parse(String str) { Map<String, Object> res; try { @SuppressWarnings("unchecked") Map<String, Object> m = runner.callMethod( parser, "parseDateToArray", Map.class, str); res = m; } catch (ScriptRunnerException e) { throw new IllegalArgumentException("Could not update items", e); } CSLDate r = CSLDate.fromJson(res); if (r.getDateParts().length == 2 && Arrays.equals(r.getDateParts()[0], r.getDateParts()[1])) { r = new CSLDateBuilder(r).dateParts(r.getDateParts()[0]).build(); } return r; } CSLDateParser(); }
CSLDateParser { public CSLDate parse(String str) { Map<String, Object> res; try { @SuppressWarnings("unchecked") Map<String, Object> m = runner.callMethod( parser, "parseDateToArray", Map.class, str); res = m; } catch (ScriptRunnerException e) { throw new IllegalArgumentException("Could not update items", e); } CSLDate r = CSLDate.fromJson(res); if (r.getDateParts().length == 2 && Arrays.equals(r.getDateParts()[0], r.getDateParts()[1])) { r = new CSLDateBuilder(r).dateParts(r.getDateParts()[0]).build(); } return r; } CSLDateParser(); CSLDate parse(String str); }
CSLDateParser { public CSLDate parse(String str) { Map<String, Object> res; try { @SuppressWarnings("unchecked") Map<String, Object> m = runner.callMethod( parser, "parseDateToArray", Map.class, str); res = m; } catch (ScriptRunnerException e) { throw new IllegalArgumentException("Could not update items", e); } CSLDate r = CSLDate.fromJson(res); if (r.getDateParts().length == 2 && Arrays.equals(r.getDateParts()[0], r.getDateParts()[1])) { r = new CSLDateBuilder(r).dateParts(r.getDateParts()[0]).build(); } return r; } CSLDateParser(); CSLDate parse(String str);  }