Hi MenoData,
Great library with support! I had a couple of questions.
import net.time4j.PrettyTime;
import java.time.ZonedDateTime;
import java.util.Locale;
....
ZonedDateTime time = ZonedDateTime.now().plusDays(2).withHour(23);
System.out.println(PrettyTime.of(Locale.forLanguageTag("en")).printRelative(ZonedDateTime.from(time)));
The result would now be "last [nameOfWeekDay]", but it would be nice to have "day before yesterday".
-
Would it be possible/good to have an extra method in the PrettyTime class for 'day before yesterday' and 'day after tomorrow'?
-
Is it possible to get a list of possible PrettyTime relatives instead of the one? So in the example above, you might get both "last [nameOfWeekDay]" and "day before yesterday". The same could go for saying something happened "last month", "1 month ago" or "last [nameOfMonth]".