Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic "time ago" display to leaderboards on beatmap overlay #16355

Merged
merged 3 commits into from
Jan 8, 2022

Conversation

bdach
Copy link
Collaborator

@bdach bdach commented Jan 7, 2022

Initial implementation of #16336.

osu_2022-01-07_19-21-45

Caveats:

  • This differs greatly from how web displays this, as web's setup is very coupled to the momentjs javascript library, to the point where the localisation analyser didn't pick up the relevant localisations as formattable strings, because they use js's %d placeholders rather than :arg laravel placeholders
  • Additionally for simplicity the rounding strategy is different. This implementation intends to floor the timespan to the largest possible whole unit (e.g. 34 hours -> 1 day, 2 months 13 days -> 2 months, 4 years 7 months -> 4 years). It's not entirely clear what momentjs does and I'm not super interested in reproducing that 1:1.
  • The actual string formatting is different from web, to reduce confusion (web displays 3 months as 3m which is confusing)
  • Implementation does not support localisations yet (requires Introduce a pluralisable string type osu-framework#4918)

@peppy peppy merged commit 3413513 into ppy:master Jan 8, 2022
@bdach bdach deleted the scoreboard-time branch January 8, 2022 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants