-
-
Notifications
You must be signed in to change notification settings - Fork 623
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
Improve relative time formatting in the notification activity. #3895
base: main
Are you sure you want to change the base?
Improve relative time formatting in the notification activity. #3895
Conversation
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.
This is an improvement, but might actually be too much of an improvement.
I'm not sure the "years ago" and "months ago" cases are really needed.
- If a notification was received "1 year ago", does it mean "1 year + 1 day", or does it mean "1 year + 364 days" ago? These are huge differences, and therefore no longer very useful.
- The "months" case will never be totally accurate because not all months have the same number of days.
Let's keep the maximum granularity as weeks
, and if the time is greater than 10 weeks in the past, keep displaying it as the regular formatted date (as before).
Also, even in the weeks
case, the DateUtils.getRelativeTimeSpanString()
function can format it for us automatically, using the WEEK_IN_MILLIS
constant, so we shouldn't need any new plurals resources.
2b57d8a
to
298c039
Compare
c795ea7
to
0ed177d
Compare
# Conflicts: # app/src/main/java/org/wikipedia/settings/Prefs.kt
# Conflicts: # app/src/main/java/org/wikipedia/settings/Prefs.kt # app/src/test/java/org/wikipedia/test/MockRetrofitTest.kt
# Conflicts: # gradle/libs.versions.toml
Improve the relative time formatting used in the notification activity for when the time difference is 1 week or greater.
Screenshots
Before
After