mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-11-26 20:06:37 -08:00
fix: Locale warning
This commit is contained in:
1 parent
372b2aebe0
commit
7db0c4f7d3
1 file changed
+4
-3
@@ -123,19 +123,20 @@ class DateInstant : Parcelable {
|
||||
}
|
||||
|
||||
fun getDateTimeString(resources: Resources): String {
|
||||
val locale = ConfigurationCompat.getLocales(resources.configuration)[0] ?: Locale.ROOT
|
||||
return when (mType) {
|
||||
Type.DATE -> DateFormat.getDateInstance(
|
||||
DateFormat.MEDIUM,
|
||||
ConfigurationCompat.getLocales(resources.configuration)[0])
|
||||
locale)
|
||||
.format(jDate)
|
||||
Type.TIME -> DateFormat.getTimeInstance(
|
||||
DateFormat.SHORT,
|
||||
ConfigurationCompat.getLocales(resources.configuration)[0])
|
||||
locale)
|
||||
.format(jDate)
|
||||
else -> DateFormat.getDateTimeInstance(
|
||||
DateFormat.MEDIUM,
|
||||
DateFormat.SHORT,
|
||||
ConfigurationCompat.getLocales(resources.configuration)[0])
|
||||
locale)
|
||||
.format(jDate)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user