RelativeYearMonthLocalizer
class RelativeYearMonthLocalizer(options: RelativeYearMonthOptions = RelativeYearMonthOptions(), locale: PlatformLocale = getDefaultLocale()) : PolyglotReferenceDateTimeLocalizer<YearMonth>
Localizes a YearMonth relative to a Zoned<Instant> reference point.
As this class implements PolyglotReferenceDateTimeLocalizer, it allows to use localizeAsFlow.
Localization could, based on options, prioritize a word style localization (e.g. last month) over a numeric style (e.g. 1 month ago).
Create once and re-use for localizing multiple values with the same options. Use YearMonth.localizeRelative or YearMonth.localizeRelativeAsFlow for one-off localizations.
Examples:
this monthlast mo.next month4 months agoin 34mo.
See also
Constructors
Link copied to clipboard
constructor(options: RelativeYearMonthOptions = RelativeYearMonthOptions(), locale: PlatformLocale = getDefaultLocale())