RelativeDurationOptions
data class RelativeDurationOptions(val minUnit: DurationUnit = DurationUnit.SECONDS, val maxUnit: DurationUnit? = null, val style: DurationStyle = DurationStyle.WIDE, val ifZeroLocalization: (PlatformLocale) -> String? = { null })(source)
Localization options for RelativeDurationLocalizer and Duration.localizeRelative
Constructors
Link copied to clipboard
constructor(minUnit: DurationUnit = DurationUnit.SECONDS, maxUnit: DurationUnit? = null, style: DurationStyle = DurationStyle.WIDE, ifZeroLocalization: (PlatformLocale) -> String? = { null })
Properties
Link copied to clipboard
string that will be returned as-is in case if the computed unit is 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 biggest unit that will be in output. If the Duration has bigger units, the output will contain the whole number of maxUnit (e.g. 123 minutes).
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 the duration unit