TickingDurationLocalizer
class TickingDurationLocalizer(options: TickingDurationOptions = TickingDurationOptions(), locale: PlatformLocale = getDefaultLocale()) : PolyglotValueLocalizer<Duration, TickingValue<String>> (source)
Localizes a Duration in the same exact way as a DurationLocalizer, but this is meant to be used to localize relative values that change over time. For static durations use DurationLocalizer instead.
The TickingValue.value will be the same as the output of Duration.localize.
For the purposes of TickingValue.nextTick, this class assumes that the given Duration is obtained from a computation that linearly "moves" backwards, i.e. a positive duration means something that will happen in the future, and a negative duration something that has happened in the past. For instance, if given the duration 10 seconds, this class assumes that in 1.5 seconds the Duration would be 8.5 seconds.
Examples:
1h 5m1 hr, 5 min1 hour, 5 minutes
Constructors
Link copied to clipboard
constructor(options: TickingDurationOptions = TickingDurationOptions(), locale: PlatformLocale = getDefaultLocale())