mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
fix: Locale warning
This commit is contained in:
@@ -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