Provide duration
This commit is contained in:
parent
98a786bfa3
commit
d26414f1d3
13 changed files with 79 additions and 73 deletions
|
|
@ -8,6 +8,7 @@
|
|||
package io.element.android.libraries.dateformatter.api
|
||||
|
||||
import java.util.Locale
|
||||
import kotlin.time.Duration
|
||||
|
||||
/**
|
||||
* Convert milliseconds to human readable duration.
|
||||
|
|
@ -38,3 +39,5 @@ fun Long.toHumanReadableDuration(): String {
|
|||
String.format(Locale.US, "%d:%02d", minutes, seconds)
|
||||
}
|
||||
}
|
||||
|
||||
fun Duration.toHumanReadableDuration() = inWholeMilliseconds.toHumanReadableDuration()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue