Osu-web: Years should not round up at 0.5

Created on 7 Oct 2018  路  5Comments  路  Source: ppy/osu-web

https://osu.ppy.sh/beatmapsets/584128
This was updated 1 year and 7 months ago, it shows as graved two years ago on my profile as it rounds up at 0.5
Rounding up years should not be a thing

screen shot 2018-10-07 at 4 48 51 pm

localisation ux

Most helpful comment

maybe just floor years then? I feel like that's what OP wanted instead

All 5 comments

Yeah, the rounding of timeago functions seem very weird at the moment.

From what I can tell the library only supports showing single unit number.

maybe just floor years then? I feel like that's what OP wanted instead

Well then it goes completely in a different way, it'd look weird if you had a 1y11m map displayed as "1 year ago".

What we want is probably something along the lines of https://date-fns.org/docs/distanceInWords
which appears to be the only javascript library that actually supports this properly with i18n?

Neither momentjs nor timeago support approximate distance, and none of their plugins that do seem to do localization properly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

smileyhead picture smileyhead  路  4Comments

gagahpangeran picture gagahpangeran  路  4Comments

DigitalHypno picture DigitalHypno  路  5Comments

Xinnoh picture Xinnoh  路  3Comments

Xinnoh picture Xinnoh  路  4Comments