Revert "Overview: display the year instead of the weekday for old chats"
This reverts commit 5e4d9c18be
.
This commit is contained in:
parent
f217ece630
commit
9663d8046c
|
@ -51,10 +51,6 @@ class VectorDateFormatter @Inject constructor(private val context: Context,
|
|||
DateTimeFormatter.ofPattern(DateFormat.getBestDateTimePattern(localeProvider.current(), "EEE d MMM"))
|
||||
}
|
||||
|
||||
private val messageDayWithYearFormatter by lazy {
|
||||
DateTimeFormatter.ofPattern(DateFormat.getBestDateTimePattern(localeProvider.current(), "d MMM YYYY"))
|
||||
}
|
||||
|
||||
fun formatMessageHour(localDateTime: LocalDateTime): String {
|
||||
return messageHourFormatter.format(localDateTime)
|
||||
}
|
||||
|
@ -63,10 +59,6 @@ class VectorDateFormatter @Inject constructor(private val context: Context,
|
|||
return messageDayFormatter.format(localDateTime)
|
||||
}
|
||||
|
||||
fun formatMessageDayWithYear(localDateTime: LocalDateTime): String {
|
||||
return messageDayWithYearFormatter.format(localDateTime)
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats a localized relative date time for the last 2 days, e.g, "Today, HH:MM", "Yesterday, HH:MM" or
|
||||
* "2 days ago, HH:MM".
|
||||
|
|
|
@ -90,14 +90,11 @@ class RoomSummaryItemFactory @Inject constructor(private val displayableEventFor
|
|||
val date = latestEvent.root.localDateTime()
|
||||
val currentDate = DateProvider.currentLocalDateTime()
|
||||
val isSameDay = date.toLocalDate() == currentDate.toLocalDate()
|
||||
val withinOneYear = currentDate.minusYears(1).isBefore(date)
|
||||
latestFormattedEvent = displayableEventFormatter.format(latestEvent, roomSummary.isDirect.not())
|
||||
latestEventTime = if (isSameDay) {
|
||||
dateFormatter.formatMessageHour(date)
|
||||
} else if (withinOneYear) {
|
||||
dateFormatter.formatMessageDay(date)
|
||||
} else {
|
||||
dateFormatter.formatMessageDayWithYear(date)
|
||||
dateFormatter.formatMessageDay(date)
|
||||
}
|
||||
}
|
||||
val typingMessage = typingHelper.getTypingMessage(roomSummary.typingUsers)
|
||||
|
|
Loading…
Reference in New Issue