public void showMeJDK8() throws Exception { PrettyTime t = new PrettyTime(); Assert.assertEquals("3 months from now", t.format(LocalDateTime.now().plusMonths(3))); } }
Improvements in the NLP module (based on Natty.) Updated to version 0.13.0
public void showMeJDK8() throws Exception { PrettyTime t = new PrettyTime(); Assert.assertEquals("3 months from now", t.format(LocalDateTime.now().plusMonths(3))); } }
Improvements in the NLP module (based on Natty.) Updated to version 0.13.0
PrettyTime allows you to create human-readable timestamps such as “3 minutes ago” or “just now”, and is used in other open-source tools such as JBoss Tools, and JBoss Developer Studio.
Enjoy, and happy holidays,
Lincoln and the OCPsoft team.
public void exampleUnitConfiguration() { JustNow unit = t.getUnit(JustNow.class); unit.setMaxQuantity(1); // This means that "just now" will only be used to represent one millisecond difference between the target time and reference time. (the default is 5 minutes.) }
Improvements in the NLP module (based on Natty.) include more resilient parsing of date offsets such as “the day before yesterday,” which previously resulted in a date that actually represented “yesterday.”
If you’ve ever looked for social-style date formatting for Java, to create timestamps like, “2 minutes from now” or “3 months ago,” [[PrettyTime]] is probably the tool you’ve ended up with, and as you might know, it supports over 25 languages and dialects – a great number to be sure. But what happens when you come across one of the over 4500 living languages that are not supported?
Well, then it’s time to do some translation, and in order to help you manage this task, we’ve created a guide to help you get through as quickly and easily as possible. When you’re done, you might even want to submit your translation back to us so that everyone else can benefit from your hard work. The guide covers this, too. It takes only a minute or so to read the guide and get started! Let us know how you do.