Use formatter for LLS duration
This commit is contained in:
+13
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user