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..86f2e66fa 100644 --- a/app/src/main/java/com/keylesspalace/tusky/util/AbsoluteTimeFormatter.kt +++ b/app/src/main/java/com/keylesspalace/tusky/util/AbsoluteTimeFormatter.kt @@ -23,7 +23,7 @@ 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 sameYearSdf = SimpleDateFormat("dd MMM, 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 } diff --git a/app/src/test/java/com/keylesspalace/tusky/util/AbsoluteTimeFormatterTest.kt b/app/src/test/java/com/keylesspalace/tusky/util/AbsoluteTimeFormatterTest.kt index 57f3bed47..435cbbc8e 100644 --- a/app/src/test/java/com/keylesspalace/tusky/util/AbsoluteTimeFormatterTest.kt +++ b/app/src/test/java/com/keylesspalace/tusky/util/AbsoluteTimeFormatterTest.kt @@ -27,11 +27,11 @@ class AbsoluteTimeFormatterTest { @Test fun `same year formatting`() { val nextDay = Date.from(Instant.parse("2022-04-12T00:10:00.00Z")) - assertEquals("04-12 00:10", formatter.format(nextDay, true, now)) - assertEquals("04-12 00:10", formatter.format(nextDay, false, now)) + assertEquals("12 Apr, 00:10", formatter.format(nextDay, true, now)) + assertEquals("12 Apr, 00:10", formatter.format(nextDay, false, now)) val endOfYear = Date.from(Instant.parse("2022-12-31T23:59:00.00Z")) - assertEquals("12-31 23:59", formatter.format(endOfYear, true, now)) - assertEquals("12-31 23:59", formatter.format(endOfYear, false, now)) + assertEquals("31 Dec, 23:59", formatter.format(endOfYear, true, now)) + assertEquals("31 Dec, 23:59", formatter.format(endOfYear, false, now)) } @Test