@Test @Ignore public void testParseSyntaxRecurring() { List<DateGroup> parse = new PrettyTimeParser().parseSyntax("I do it every three days"); Assert.assertFalse(parse.isEmpty()); String formatted = new PrettyTime(Locale.ENGLISH).format(parse.get(0).getDates().get(0)); Assert.assertEquals("3 days from now", formatted); Assert.assertEquals(1, parse.get(0).getLine()); Assert.assertEquals(14, parse.get(0).getPosition()); Assert.assertEquals(1, parse.get(0).getDates().size()); Assert.assertNull(parse.get(0).getRecursUntil()); Assert.assertTrue(parse.get(0).isRecurring()); Assert.assertEquals(1000 * 60 * 60 * 24 * 3l, parse.get(0).getRecurInterval()); }
public List<DateGroup> parseSyntax(String language) { language = words2numbers(language); List<DateGroup> result = new ArrayList<DateGroup>(); List<com.joestelmach.natty.DateGroup> groups = parser.parse(language); Date now = new Date(); for (com.joestelmach.natty.DateGroup group : groups) { result.add(new DateGroupImpl(now, group)); } return result; }
PrettyTimeParser { public List<DateGroup> parseSyntax(String language) { language = words2numbers(language); List<DateGroup> result = new ArrayList<DateGroup>(); List<com.joestelmach.natty.DateGroup> groups = parser.parse(language); Date now = new Date(); for (com.joestelmach.natty.DateGroup group : groups) { result.add(new DateGroupImpl(now, group)); } return result; } }
PrettyTimeParser { public List<DateGroup> parseSyntax(String language) { language = words2numbers(language); List<DateGroup> result = new ArrayList<DateGroup>(); List<com.joestelmach.natty.DateGroup> groups = parser.parse(language); Date now = new Date(); for (com.joestelmach.natty.DateGroup group : groups) { result.add(new DateGroupImpl(now, group)); } return result; } PrettyTimeParser(TimeZone timezone);  PrettyTimeParser(); }
PrettyTimeParser { public List<DateGroup> parseSyntax(String language) { language = words2numbers(language); List<DateGroup> result = new ArrayList<DateGroup>(); List<com.joestelmach.natty.DateGroup> groups = parser.parse(language); Date now = new Date(); for (com.joestelmach.natty.DateGroup group : groups) { result.add(new DateGroupImpl(now, group)); } return result; } PrettyTimeParser(TimeZone timezone);  PrettyTimeParser(); List<Date> parse(String language); List<DateGroup> parseSyntax(String language); }
PrettyTimeParser { public List<DateGroup> parseSyntax(String language) { language = words2numbers(language); List<DateGroup> result = new ArrayList<DateGroup>(); List<com.joestelmach.natty.DateGroup> groups = parser.parse(language); Date now = new Date(); for (com.joestelmach.natty.DateGroup group : groups) { result.add(new DateGroupImpl(now, group)); } return result; } PrettyTimeParser(TimeZone timezone);  PrettyTimeParser(); List<Date> parse(String language); List<DateGroup> parseSyntax(String language);  }