mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-06 18:57:26 +01:00
Don't show future timestamps as Recently (#9773)
This commit is contained in:
parent
db788d519d
commit
e2abf283fe
@ -120,7 +120,7 @@ fun Date.toRelativeString(
|
|||||||
val difference = now.timeWithOffset.floorNearest(MILLISECONDS_IN_DAY) - this.timeWithOffset.floorNearest(MILLISECONDS_IN_DAY)
|
val difference = now.timeWithOffset.floorNearest(MILLISECONDS_IN_DAY) - this.timeWithOffset.floorNearest(MILLISECONDS_IN_DAY)
|
||||||
val days = difference.floorDiv(MILLISECONDS_IN_DAY).toInt()
|
val days = difference.floorDiv(MILLISECONDS_IN_DAY).toInt()
|
||||||
return when {
|
return when {
|
||||||
difference < 0 -> context.getString(R.string.recently)
|
difference < 0 -> dateFormat.format(this)
|
||||||
difference < MILLISECONDS_IN_DAY -> context.getString(R.string.relative_time_today)
|
difference < MILLISECONDS_IN_DAY -> context.getString(R.string.relative_time_today)
|
||||||
difference < MILLISECONDS_IN_DAY.times(7) -> context.resources.getQuantityString(
|
difference < MILLISECONDS_IN_DAY.times(7) -> context.resources.getQuantityString(
|
||||||
R.plurals.relative_time,
|
R.plurals.relative_time,
|
||||||
|
@ -223,7 +223,6 @@
|
|||||||
<string name="pref_show_nsfw_source">Show in sources and extensions lists</string>
|
<string name="pref_show_nsfw_source">Show in sources and extensions lists</string>
|
||||||
<string name="parental_controls_info">This does not prevent unofficial or potentially incorrectly flagged extensions from surfacing NSFW (18+) content within the app.</string>
|
<string name="parental_controls_info">This does not prevent unofficial or potentially incorrectly flagged extensions from surfacing NSFW (18+) content within the app.</string>
|
||||||
|
|
||||||
<string name="recently">Recently</string>
|
|
||||||
<string name="relative_time_today">Today</string>
|
<string name="relative_time_today">Today</string>
|
||||||
<plurals name="relative_time">
|
<plurals name="relative_time">
|
||||||
<item quantity="one">Yesterday</item>
|
<item quantity="one">Yesterday</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user