Fix wrong Duration short formatting (#7167)

This commit is contained in:
Timo T 2022-06-15 19:00:13 +02:00 committed by GitHub
parent 0585194eaf
commit 89a7cc7246
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,7 +51,7 @@ private fun Duration.toParts(): SortedMap<ChronoUnit, Long> {
fun Duration.formatShort(): String {
val parts = toParts()
for ((unit, part) in parts) {
if (part > 2) return "[${part}] $unit".tr()
if (part > 0) return "[${part}] $unit".tr()
}
return "[${parts[ChronoUnit.SECONDS]}] ${ChronoUnit.SECONDS}".tr()
}