Closed moontoaster closed 2 months ago
I could write a pull request for this, should I?
@moontoaster Hey! Thanks so much for submitting this issue. Absolutely a pull request would be VERY welcome for this! I appreciate your time and energy in finding this bug, writing a test, and offering to help.
Also feel free to add the new test as well!
Sorry for the delay - we've got a new baby in the house and are overloaded right now!
I have made a pull request. Congrats on the baby!
@moontoaster Thank you! I will get this merged and released ASAP :D He's super cute already and takes soooo much time. I always "knew" but now I "know".
Released 5.0.8.Final with this fix. It should be available in central as soon as it syncs from the Sonatype release server.
Thank you! Sorry for the late response, for some reason notifications don't show up in GitHub's UI
You're very welcome :) Thank YOU for the fix!
When using
PrettyTime.formatUnrounded
with a date in the past and locale set to Ukrainian, the time will have a negative sign prepended to it, like so: -10 хвилин тому (-10 minutes ago).This is due to Ukrainian locale using duration's quantity directly, which can be negative.
Polish locale, which has similar code structure to Ukrainian locale, solves this by getting the absolute value of duration's quantity in unrounded functions.
I wrote a tiny test that reproduces this bug. It's located at https://github.com/moontoastingenterprises/prettytime-bug-repro. When I ran it, the
testFormatUnrounded
test failed with the following: