ocpsoft / prettytime

Social Style Date and Time Formatting for Java
http://ocpsoft.org/prettytime/
Apache License 2.0
1.29k stars 252 forks source link

Duration of 60 seconds or less formats as empty string #226

Open andrzejpolis opened 2 years ago

andrzejpolis commented 2 years ago

When I try to format duration of 60 seconds or less it gives me empty string regardless of locale.

        val seconds = 30L
        val locale = Locale("en", "US")
        val t = PrettyTime(Date(1000 * seconds), locale)
            .calculatePreciseDuration(Date(0))
        val result = PrettyTime(locale).formatDurationUnrounded(t)

        assertThat(result).isEqualTo("30 seconds")