DurationOptions
data class DurationOptions(val minUnit: DurationUnit = DurationUnit.SECONDS, val maxUnits: Int = 2, val omitZeros: Boolean = true, val style: DurationStyle = DurationStyle.WIDE, val ifZeroLocalization: (PlatformLocale) -> String? = { null })(source)
Localization options for DurationLocalizer and Duration.localize
Constructors
Link copied to clipboard
constructor(minUnit: DurationUnit = DurationUnit.SECONDS, maxUnits: Int = 2, omitZeros: Boolean = true, style: DurationStyle = DurationStyle.WIDE, ifZeroLocalization: (PlatformLocale) -> String? = { null })
Properties
Link copied to clipboard
string that will be returned as-is in case if all allowable units to display are zero. Note that this doesn't necessarily mean that the passed Duration is itself Duration.ZERO, but rather that it's smaller than the minUnit. If this is null, the default 0 <min-unit> localized string will be returned in this case.
Link copied to clipboard
the smallest unit that will be in output. If the Duration is smaller, 0 <min-unit> will be returned (see also the ifZeroLocalization parameter)
Link copied to clipboard
the style of duration units, Also applies to the style of the list (in case there is more than one unit to show)