Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e4e1721 authored by Moez Bhatti's avatar Moez Bhatti
Browse files

Zero-pad 24 hour timestamps

parent f18e7663
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)
    }