-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix display since time round #14226
Fix display since time round #14226
Conversation
I wonder if we might benefit from writing out what times we're aiming to display. I'd also note that in British English we're likely to consider 18 months a half-way point between 1 year & 2 years. Not sure if it is the same in US English & International English though. |
might be worth taking a look at http://timeago.yarp.com/ |
A frontend solution may make i18n difficult. |
unit tests fail |
I wasn't suggesting using that library rather check/copy its algorithm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but what about the case for leap years?
895e071
to
6761eab
Compare
6761eab
to
5d6b580
Compare
Just ignored that. We just calculate the time distance. |
Codecov Report
@@ Coverage Diff @@
## master #14226 +/- ##
==========================================
+ Coverage 42.09% 42.13% +0.04%
==========================================
Files 758 758
Lines 81106 81181 +75
==========================================
+ Hits 34139 34205 +66
- Misses 41386 41391 +5
- Partials 5581 5585 +4
Continue to review full report at Codecov.
|
Please send backport |
Backport go-gitea#14226 * Fix display since time round * Fix since time * Fix tests
This PR introduces rounding off numbers for time since.
i.e. Before, 1.6 year still displayed 1 year,
After 1.4 year will display 1 year, but 1.5 year will display 2 years.
Fix #4917