From d49fcb80fc710b30c157f42c7cd081031538971c Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 20 May 2020 23:52:41 +0200 Subject: [PATCH] "Seen by" uses 12h time (Fixes #1378) DateUtils.FORMAT_SHOW_TIME has to be used for i18n to be effective on DateUtils.getRelativeDateTimeString(), do not ask me why. Also internal switching of language does not have effect on this method, you'll have to restart the application. --- CHANGES.md | 1 + .../im/vector/riotx/core/date/VectorDateFormatter.kt | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index bb02b798e0..12d4d7a2ca 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,7 @@ Improvements 🙌: Bugfix 🐛: - After jump to unread, newer messages are never loaded (#1008) - Fix issues with FontScale switch (#69, #645) + - "Seen by" uses 12h time (#1378) Translations 🗣: - diff --git a/vector/src/main/java/im/vector/riotx/core/date/VectorDateFormatter.kt b/vector/src/main/java/im/vector/riotx/core/date/VectorDateFormatter.kt index 367615d765..344398b91e 100644 --- a/vector/src/main/java/im/vector/riotx/core/date/VectorDateFormatter.kt +++ b/vector/src/main/java/im/vector/riotx/core/date/VectorDateFormatter.kt @@ -45,11 +45,12 @@ class VectorDateFormatter @Inject constructor(private val context: Context, if (time == null) { return "" } - return DateUtils.getRelativeDateTimeString(context, - time, - DateUtils.DAY_IN_MILLIS, - 2 * DateUtils.DAY_IN_MILLIS, - DateUtils.FORMAT_SHOW_WEEKDAY + return DateUtils.getRelativeDateTimeString( + context, + time, + DateUtils.DAY_IN_MILLIS, + 2 * DateUtils.DAY_IN_MILLIS, + DateUtils.FORMAT_SHOW_WEEKDAY or DateUtils.FORMAT_SHOW_TIME ).toString() } }