mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-02 00:17:41 +01:00
Use app locale when formatting LocalTime, rather than system locale.
This commit is contained in:
committed by
Michelle Tang
parent
4d2f23ec37
commit
d2619a6abd
@@ -95,7 +95,7 @@ fun LocalTime.formatHours(context: Context): String {
|
||||
// We have to create our own pattern here, since the formatter instance returned by DateTimeFormatter.ofLocalizedTime() is looked up lazily, is immutable,
|
||||
// and is not updated when the system's 24-hour time setting changes.
|
||||
val pattern = if (DateFormat.is24HourFormat(context)) "HH:mm" else "h:mm a"
|
||||
return DateTimeFormatter.ofPattern(pattern, Locale.getDefault()).format(this)
|
||||
return DateTimeFormatter.ofPattern(pattern, LocaleUtil.getFirstLocale()).format(this)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user