MenoData / Time4J

Advanced date, time and interval library for Java with sun/moon-astronomy and calendars like Chinese, Coptic, Ethiopian, French Republican, Hebrew, Hijri, Historic Christian, Indian National, Japanese, Julian, Korean, Minguo, Persian, Thai, Vietnamese
GNU Lesser General Public License v2.1
424 stars 62 forks source link

Enable PrettyTime with non-decimal numerals #958

Closed MenoData closed 2 years ago

MenoData commented 2 years ago

Example for the new method withNumerals(NumberSystem):

    Duration<?> duration =
        Duration.ofCalendarUnits(15, 3, 2);
    assertThat(
        PrettyTime.of(Locale.ENGLISH)
            .withNumerals(NumberSystem.ROMAN)
            .print(duration, TextWidth.WIDE),
        is("XV years, III months, and II days"));