android, desktop: fix previous years display on chat view (#5486)

This commit is contained in:
Diogo
2025-01-07 20:58:22 +00:00
committed by GitHub
parent e3e5d9646c
commit f33a9650bc

View File

@@ -2540,7 +2540,7 @@ fun getTimestampDateText(t: Instant): String {
val time = t.toLocalDateTime(tz).toJavaLocalDateTime()
val weekday = time.format(DateTimeFormatter.ofPattern("EEE"))
val dayMonthYear = time.format(DateTimeFormatter.ofPattern(
if (Clock.System.now().toLocalDateTime(tz).year == time.year) "d MMM" else "d MMM YYYY")
if (Clock.System.now().toLocalDateTime(tz).year == time.year) "d MMM" else "d MMM yyyy")
)
return "$weekday, $dayMonthYear"