diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt index 0be0fd3bd6..1bd5361273 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt @@ -2423,11 +2423,11 @@ data class CITimed( val deleteAt: Instant? ) -fun getDateText(t: Instant): String { +fun getTimestampDateText(t: Instant): String { val tz = TimeZone.currentSystemDefault() - val time = t.toLocalDateTime(tz) - val weekday = time.toJavaLocalDateTime().format(DateTimeFormatter.ofPattern("EEE", Locale.getDefault())) - val dayMonthYear = time.toJavaLocalDateTime().format(DateTimeFormatter.ofPattern( + val time = t.toLocalDateTime(tz).toJavaLocalDateTime() + val weekday = time.format(DateTimeFormatter.ofPattern("EEE", Locale.getDefault())) + val dayMonthYear = time.format(DateTimeFormatter.ofPattern( if (Clock.System.now().toLocalDateTime(tz).year == time.year) "d MMM" else "d MMM YYYY", Locale.getDefault()) ) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt index 9f98d5fa88..90d0999d06 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt @@ -43,7 +43,6 @@ import kotlinx.coroutines.flow.* import kotlinx.datetime.* import java.io.File import java.net.URI -import java.time.format.DateTimeFormatter import kotlin.math.abs import kotlin.math.sign @@ -1518,8 +1517,8 @@ private fun ButtonRow(horizontalArrangement: Arrangement.Horizontal, content: @C @Composable fun DateSeparator(date: Instant) { Text( - text = getDateText(date), - fontSize = 16.sp, + text = getTimestampDateText(date), + fontSize = 14.sp, fontWeight = FontWeight.Medium, color = MaterialTheme.colors.secondary ) @@ -1912,7 +1911,7 @@ private fun getItemSeparation(chatItem: ChatItem, nextItem: ChatItem?): ItemSepa return ItemSeparation( timestamp = largeGap || chatItem.meta.timestampText != nextItem.meta.timestampText, largeGap = largeGap, - date = if (getDateText(chatItem.meta.itemTs) != getDateText(nextItem.meta.itemTs)) nextItem.meta.itemTs else null + date = if (getTimestampDateText(chatItem.meta.itemTs) != getTimestampDateText(nextItem.meta.itemTs)) nextItem.meta.itemTs else null ) }