Relative Date Absolute Time Localizer
class RelativeDateAbsoluteTimeLocalizer(options: RelativeDateAbsoluteTimeOptions = RelativeDateAbsoluteTimeOptions(), locale: PlatformLocale = getDefaultLocale()) : PolyglotReferenceValueLocalizer<LocalDateTime> (source)
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 LocalDateTime.localizeRelativeDateAbsoluteTime or LocalDateTime.localizeRelativeDateAbsoluteTimeAsFlow for one-off localizations.
Examples:
yesterday at 9:00 PMnext Sunday at 4:00 AMin 15 days, 3:00 AM21 days ago at 7:00 PM
Constructors
Link copied to clipboard
constructor(options: RelativeDateAbsoluteTimeOptions = RelativeDateAbsoluteTimeOptions(), locale: PlatformLocale = getDefaultLocale())
Functions
Link copied to clipboard
Link copied to clipboard
fun <T> PolyglotReferenceValueLocalizer<T>.localizeAsFlow(value: T, clock: Clock = Clock.System, maxTick: Duration? = null): Flow<String>