Fix off by 1 dates (fixes #6791)

This commit is contained in:
arkon
2022-03-24 18:49:00 -04:00
parent 8e332dba30
commit 5c0a43e8d6
3 changed files with 4 additions and 4 deletions

View File

@@ -112,8 +112,8 @@ fun Date.toRelativeString(
val days = difference.floorDiv(MILLISECONDS_IN_DAY).toInt()
return when {
difference < 0 -> context.getString(R.string.recently)
difference < MILLISECONDS_IN_DAY -> context.getString(R.string.relative_time_today)
difference < MILLISECONDS_IN_DAY.times(range) -> context.resources.getQuantityString(
difference <= MILLISECONDS_IN_DAY -> context.getString(R.string.relative_time_today)
difference <= MILLISECONDS_IN_DAY.times(range) -> context.resources.getQuantityString(
R.plurals.relative_time,
days,
days