forked from upstream-mirrors/quik
Properly remove AM/PM indicator
I observed that the space before the AM/PM indicator was really an NBSP which caused the original pattern to not match. This pattern, which uses `\s` instead, should match any type of spacing.
This commit is contained in:
@@ -42,7 +42,7 @@ class DateFormatter @Inject constructor(val context: Context) {
|
|||||||
formattedPattern = formattedPattern
|
formattedPattern = formattedPattern
|
||||||
.replace("h", "HH")
|
.replace("h", "HH")
|
||||||
.replace("K", "HH")
|
.replace("K", "HH")
|
||||||
.replace(" a".toRegex(), "")
|
.replace("\\s+a".toRegex(), "")
|
||||||
}
|
}
|
||||||
|
|
||||||
return SimpleDateFormat(formattedPattern, Locale.getDefault())
|
return SimpleDateFormat(formattedPattern, Locale.getDefault())
|
||||||
|
|||||||
Reference in New Issue
Block a user