RelativeInstantLocalizer
Localizes an Instant relative to another one.
This class is a simple convenience over RelativeDurationLocalizer, simply calculating the diff and forwarding the localization request to it. As this implements PolyglotReferenceDateTimeLocalizer, this allows to use localizeAsFlow.
For this reason, the options required here are identical to RelativeDurationLocalizer.
Create once and re-use for localizing multiple values with the same options. Use Instant.localizeRelative or Instant.localizeRelativeAsFlow for one-off localizations.
Examples:
10 minutes agoin 1 hour4h ago4 hr. agoin 2 days
See also
Constructors
Functions
Returns a new PolyglotReferenceValueLocalizer that localizes the received value using this localizer, calls map, and returns whatever TickingValue the mapping function returns.
Fixes the value to localize and returns a TickingValueProvider using this PolyglotReferenceValueLocalizer as source for TickingValues.