From 3e9903b3306fb3ef99661e07fd67e21d1ea9c6b1 Mon Sep 17 00:00:00 2001 From: kyori19 Date: Thu, 5 May 2022 16:22:56 +0900 Subject: [PATCH] Add seconds display for absolute time same day format --- .../com/keylesspalace/tusky/util/AbsoluteTimeFormatter.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/util/AbsoluteTimeFormatter.kt b/app/src/main/java/com/keylesspalace/tusky/util/AbsoluteTimeFormatter.kt index 7d46388ba..78c3c01bd 100644 --- a/app/src/main/java/com/keylesspalace/tusky/util/AbsoluteTimeFormatter.kt +++ b/app/src/main/java/com/keylesspalace/tusky/util/AbsoluteTimeFormatter.kt @@ -22,10 +22,10 @@ import java.util.Locale import java.util.TimeZone class AbsoluteTimeFormatter @JvmOverloads constructor(private val tz: TimeZone = TimeZone.getDefault()) { - private val sameDaySdf = SimpleDateFormat("HH:mm", Locale.getDefault()).apply { this.timeZone = tz } - private val sameYearSdf = SimpleDateFormat("MM-dd HH:mm", Locale.getDefault()).apply { this.timeZone = tz } - private val otherYearSdf = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()).apply { this.timeZone = tz } - private val otherYearCompleteSdf = SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault()).apply { this.timeZone = tz } + private val sameDaySdf = SimpleDateFormat("HH:mm:ss", Locale.getDefault()).apply { this.timeZone = tz } + private val sameYearSdf = SimpleDateFormat("MM/dd HH:mm", Locale.getDefault()).apply { this.timeZone = tz } + private val otherYearSdf = SimpleDateFormat("yyyy/MM/dd", Locale.getDefault()).apply { this.timeZone = tz } + private val otherYearCompleteSdf = SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.getDefault()).apply { this.timeZone = tz } @JvmOverloads fun format(time: Date?, shortFormat: Boolean = true, now: Date = Date()): String {