DynamicYearMonthLocalizer

class DynamicYearMonthLocalizer(options: DynamicYearMonthOptions = DynamicYearMonthOptions(), locale: PlatformLocale = getDefaultLocale()) : PolyglotReferenceDateTimeLocalizer<YearMonth>

Localizes a YearMonth dynamically (either absolute or relative to a Zoned<Instant> reference point).

This class chooses between formatting with a RelativeYearMonthLocalizer (if the difference is within the configured range), or falls back to absolute formatting via YearMonthLocalizer.

Create once and re-use for localizing multiple values with the same options. Use YearMonth.localizeDynamic or YearMonth.localizeDynamicAsFlow for one-off localizations.

Examples:

  • last month

  • 1 month ago

  • in 5 mo

  • 07/2026

  • July 2026

See also

Constructors

Link copied to clipboard
constructor(options: DynamicYearMonthOptions = DynamicYearMonthOptions(), locale: PlatformLocale = getDefaultLocale())

Functions

Link copied to clipboard
open override fun localize(value: YearMonth, reference: Zoned<Instant>): TickingValue<String>