mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-16 19:18:52 +01:00
Zero-pad 24 hour timestamps
This commit is contained in:
@@ -37,7 +37,7 @@ class DateFormatter @Inject constructor(val context: Context) {
|
||||
private fun getFormatter(pattern: String): SimpleDateFormat {
|
||||
val isUsing24HourTime = DateFormat.is24HourFormat(context)
|
||||
|
||||
return if (isUsing24HourTime) SimpleDateFormat(pattern.replace('h', 'H').replace(" a".toRegex(), ""), Locale.US)
|
||||
return if (isUsing24HourTime) SimpleDateFormat(pattern.replace("h", "HH").replace(" a".toRegex(), ""), Locale.US)
|
||||
else SimpleDateFormat(pattern, Locale.US)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user