From f90599451f9660e4a64964481eacdf65070dc092 Mon Sep 17 00:00:00 2001 From: Al Lansley Date: Fri, 30 Aug 2024 09:13:51 +1000 Subject: [PATCH] Replaced 'now' with 12/24 hour time --- .../java/org/thoughtcrime/securesms/util/DateUtils.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/util/DateUtils.kt b/app/src/main/java/org/thoughtcrime/securesms/util/DateUtils.kt index 5d5610f506..10d2fceb79 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/util/DateUtils.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/util/DateUtils.kt @@ -92,11 +92,9 @@ object DateUtils : android.text.format.DateUtils() { } 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 - return if (timestamp == 0L || isWithin(timestamp, 1, TimeUnit.MINUTES)) { - // TODO ACL: Adjust as per SES-360 - "Now" - } else if (isToday(timestamp)) { + // If the timestamp is within the last 24 hours we just give the time, e.g, "1:23 PM" or + // "13:23" depending on 12/24 hour formatting. + return if (isToday(timestamp)) { getFormattedDateTime(timestamp, getHourFormat(c), locale) } else if (isWithin(timestamp, 6, TimeUnit.DAYS)) { getFormattedDateTime(timestamp, "EEE " + getHourFormat(c), locale)