Use formatter for LLS duration
This commit is contained in:
parent
6507a2e8cb
commit
dee8ce27e7
12 changed files with 275 additions and 24 deletions
|
|
@ -11,6 +11,19 @@ package io.element.android.libraries.dateformatter.api
|
|||
import java.util.Locale
|
||||
import kotlin.time.Duration
|
||||
|
||||
/**
|
||||
* Formats a duration in a localized, human-readable way.
|
||||
* Uses the largest appropriate unit (hours, minutes, or seconds).
|
||||
*
|
||||
* Examples (in English):
|
||||
* - 2 hours 30 minutes → "3 hours" (rounded)
|
||||
* - 45 minutes → "45 minutes"
|
||||
* - 30 seconds → "30 seconds"
|
||||
*/
|
||||
interface DurationFormatter {
|
||||
fun format(duration: Duration): String
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert milliseconds to human readable duration.
|
||||
* Hours in 1 digit or more.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue