RelativeDateAbsoluteTimeLocalizer

class RelativeDateAbsoluteTimeLocalizer(options: RelativeDateAbsoluteTimeOptions = RelativeDateAbsoluteTimeOptions(), locale: PlatformLocale = getDefaultLocale()) : PolyglotReferenceDateTimeLocalizer<LocalDateTime>

Localizes the date part of a LocalDateTime relative to a Zoned<Instant> reference point, and the time part absolutely.

This is mostly glue between RelativeLocalDateLocalizer and LocalTimeLocalizer. See their documentation to understand RelativeDateAbsoluteTimeOptions.dateOptions and RelativeDateAbsoluteTimeOptions.timeOptions.

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

Examples:

  • yesterday at 9:00 PM

  • next Sunday at 4:00 AM

  • in 15 days, 3:00 AM

  • 21 days ago at 7:00 PM

Constructors

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

Functions

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