Replaced 'now' with 12/24 hour time

This commit is contained in:
Al Lansley 2024-08-30 09:13:51 +10:00
parent 16b8ad46c0
commit f90599451f

View File

@ -92,11 +92,9 @@ object DateUtils : android.text.format.DateUtils() {
} }
fun getDisplayFormattedTimeSpanString(c: Context, locale: Locale, timestamp: Long): String { fun getDisplayFormattedTimeSpanString(c: Context, locale: Locale, timestamp: Long): String {
// If the timestamp is invalid (ie. 0) then assume we're waiting on data and just use the 'Now' copy // If the timestamp is within the last 24 hours we just give the time, e.g, "1:23 PM" or
return if (timestamp == 0L || isWithin(timestamp, 1, TimeUnit.MINUTES)) { // "13:23" depending on 12/24 hour formatting.
// TODO ACL: Adjust as per SES-360 return if (isToday(timestamp)) {
"Now"
} else if (isToday(timestamp)) {
getFormattedDateTime(timestamp, getHourFormat(c), locale) getFormattedDateTime(timestamp, getHourFormat(c), locale)
} else if (isWithin(timestamp, 6, TimeUnit.DAYS)) { } else if (isWithin(timestamp, 6, TimeUnit.DAYS)) {
getFormattedDateTime(timestamp, "EEE " + getHourFormat(c), locale) getFormattedDateTime(timestamp, "EEE " + getHourFormat(c), locale)