mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-15 01:35:07 +08:00
Fix date format of some Asian languages (#1928)
With DateFormat.getBestDateTimePattern to generate best localized pattern. Signed-off-by: Yihong Gao <yihong.ui@gmail.com>
This commit is contained in:
parent
68d128133c
commit
e3b7f167ff
@ -10,6 +10,7 @@ Improvements 🙌:
|
||||
- Ensure users do not accidentally ignore other users (#1890)
|
||||
|
||||
Bugfix 🐛:
|
||||
- Fix incorrect date format for some Asian languages (#1928)
|
||||
- Fix invisible toolbar (Status.im theme) (#1746)
|
||||
- Fix relative date time formatting (#822)
|
||||
- Fix crash reported by RageShake
|
||||
|
@ -17,6 +17,7 @@
|
||||
package im.vector.app.core.date
|
||||
|
||||
import android.content.Context
|
||||
import android.text.format.DateFormat
|
||||
import android.text.format.DateUtils
|
||||
import im.vector.app.core.resources.LocaleProvider
|
||||
import org.threeten.bp.LocalDateTime
|
||||
@ -45,8 +46,9 @@ class VectorDateFormatter @Inject constructor(private val context: Context,
|
||||
private val messageHourFormatter by lazy {
|
||||
DateTimeFormatter.ofPattern("H:mm", localeProvider.current())
|
||||
}
|
||||
|
||||
private val messageDayFormatter by lazy {
|
||||
DateTimeFormatter.ofPattern("EEE d MMM", localeProvider.current())
|
||||
DateTimeFormatter.ofPattern(DateFormat.getBestDateTimePattern(localeProvider.current(), "EEE d MMM"))
|
||||
}
|
||||
|
||||
fun formatMessageHour(localDateTime: LocalDateTime): String {
|
||||
|
Loading…
Reference in New Issue
Block a user