Package-level declarations

Types

Link copied to clipboard
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.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class RelativeDurationLocalizer(options: RelativeDurationOptions = RelativeDurationOptions(), locale: PlatformLocale = getDefaultLocale()) : PolyglotValueLocalizer<Duration, TickingValue<String>>

Localizes a single Duration unit (usually the biggest one) in a relative way.

Link copied to clipboard
data class RelativeDurationOptions(val minUnit: DurationUnit = DurationUnit.SECONDS, val maxUnit: DurationUnit? = null, val style: RelativeUnitStyle = RelativeUnitStyle.LONG, val ifZeroLocalization: IfZeroLocalization = { if (minUnit == DurationUnit.SECONDS) { localizeNow() } else { null } }) : PolyglotLocalizerOptions<RelativeDurationLocalizer>
Link copied to clipboard
class RelativeInstantLocalizer(options: RelativeInstantOptions = RelativeInstantOptions(), locale: PlatformLocale = getDefaultLocale()) : PolyglotReferenceDateTimeLocalizer<Instant>

Localizes an Instant relative to another one.

Link copied to clipboard
Link copied to clipboard
class RelativeLocalDateLocalizer(options: RelativeLocalDateOptions = RelativeLocalDateOptions(), locale: PlatformLocale = getDefaultLocale()) : PolyglotReferenceDateTimeLocalizer<LocalDate>

Localizes a LocalDate relative to a Zoned<Instant> reference point.

Link copied to clipboard
data class RelativeLocalDateOptions(val style: RelativeUnitStyle = RelativeUnitStyle.LONG, val allowedDirections: Set<RelativeDirection> = RelativeDirection.entries.toSet(), val useRelativeDayOfWeek: Boolean = false) : RelativeUnitOptions, PolyglotLocalizerOptions<RelativeLocalDateLocalizer>
Link copied to clipboard
class RelativeYearLocalizer(options: RelativeYearOptions = RelativeYearOptions(), locale: PlatformLocale = getDefaultLocale()) : PolyglotReferenceDateTimeLocalizer<Int>

Localizes a year relative to a Zoned<Instant> reference point.

Link copied to clipboard
class RelativeYearMonthLocalizer(options: RelativeYearMonthOptions = RelativeYearMonthOptions(), locale: PlatformLocale = getDefaultLocale()) : PolyglotReferenceDateTimeLocalizer<YearMonth>

Localizes a YearMonth relative to a Zoned<Instant> reference point.

Link copied to clipboard
data class RelativeYearMonthOptions(val style: RelativeUnitStyle = RelativeUnitStyle.LONG, val allowedDirections: Set<RelativeDirection> = RelativeDirection.entries.toSet()) : RelativeUnitOptions, PolyglotLocalizerOptions<RelativeYearMonthLocalizer>
Link copied to clipboard
data class RelativeYearOptions(val style: RelativeUnitStyle = RelativeUnitStyle.LONG, val allowedDirections: Set<RelativeDirection> = RelativeDirection.entries.toSet()) : RelativeUnitOptions, PolyglotLocalizerOptions<RelativeYearLocalizer>

Localization options for RelativeYearLocalizer.

Link copied to clipboard
class RelativeZonedYearLocalizer(options: RelativeZonedYearOptions = RelativeZonedYearOptions(), locale: PlatformLocale = getDefaultLocale()) : PolyglotReferenceDateTimeZonedLocalizer<Int>

Localizes a Zoned year (Zoned<Int>) relative to a Zoned<Instant> reference point.

Link copied to clipboard
data class RelativeZonedYearOptions(val yearOptions: RelativeYearOptions = RelativeYearOptions(), val timeZoneOptions: TimeZoneOptions = TimeZoneOptions()) : PolyglotLocalizerOptions<RelativeZonedYearLocalizer>

Localization options for RelativeZonedYearLocalizer.

Functions

Link copied to clipboard
fun Duration.localizeRelative(options: RelativeDurationOptions = RelativeDurationOptions(), locale: PlatformLocale = getDefaultLocale()): TickingValue<String>

Localizes this Duration relatively with a single unit with the given options in the given locale.

fun Instant.localizeRelative(reference: Instant, options: RelativeInstantOptions = RelativeInstantOptions(), locale: PlatformLocale = getDefaultLocale()): TickingValue<String>

Localizes this Instant relatively with respect to reference, with a single unit with the given options in the given locale.

fun LocalDate.localizeRelative(reference: Zoned<Instant>, options: RelativeLocalDateOptions = RelativeLocalDateOptions(), locale: PlatformLocale = getDefaultLocale()): TickingValue<String>

Localizes this LocalDate relatively with respect to reference, with a single unit with the given options in the given locale.

fun YearMonth.localizeRelative(reference: Zoned<Instant>, options: RelativeYearMonthOptions = RelativeYearMonthOptions(), locale: PlatformLocale = getDefaultLocale()): TickingValue<String>

Localizes this YearMonth relatively with respect to reference, with a single unit with the given options in the given locale.

Link copied to clipboard
fun Instant.localizeRelativeAsFlow(options: RelativeInstantOptions = RelativeInstantOptions(), locale: PlatformLocale = getDefaultLocale(), clock: Flow<ClockWrapper> = SYSTEM_CLOCK, timeZone: Flow<TimeZone> = SYSTEM_TIMEZONE): Flow<String>

Localizes this Instant relatively with respect to clock @ timeZone, with a single unit with the given options in the given locale, returning a Flow.

fun LocalDate.localizeRelativeAsFlow(options: RelativeLocalDateOptions = RelativeLocalDateOptions(), locale: PlatformLocale = getDefaultLocale(), clock: Flow<ClockWrapper> = SYSTEM_CLOCK, timeZone: Flow<TimeZone> = SYSTEM_TIMEZONE): Flow<String>

Localizes this LocalDate relatively with respect to clock @ timeZone, with a single unit with the given options in the given locale, returning a Flow that automatically receives new localizations as they are needed.

fun YearMonth.localizeRelativeAsFlow(options: RelativeYearMonthOptions = RelativeYearMonthOptions(), locale: PlatformLocale = getDefaultLocale(), clock: Flow<ClockWrapper> = SYSTEM_CLOCK, timeZone: Flow<TimeZone> = SYSTEM_TIMEZONE): Flow<String>

Localizes this YearMonth relatively with respect to clock @ timeZone, with a single unit with the given options in the given locale, returning a Flow that automatically receives new localizations as they are needed.

Link copied to clipboard
fun LocalDateTime.localizeRelativeDateAbsoluteTime(reference: Zoned<Instant>, options: RelativeDateAbsoluteTimeOptions = RelativeDateAbsoluteTimeOptions(), locale: PlatformLocale = getDefaultLocale()): TickingValue<String>

Localizes this LocalDateTime relatively with respect to reference, with a single unit with the given options in the given locale.

Link copied to clipboard
fun LocalDateTime.localizeRelativeDateAbsoluteTimeAsFlow(options: RelativeDateAbsoluteTimeOptions = RelativeDateAbsoluteTimeOptions(), locale: PlatformLocale = getDefaultLocale(), clock: Flow<ClockWrapper> = SYSTEM_CLOCK, timeZone: Flow<TimeZone> = SYSTEM_TIMEZONE): Flow<String>

Localizes this LocalDateTime relatively with respect to clock @ timeZone, with a single unit with the given options in the given locale, returning a Flow that automatically receives new localizations as they are needed.

Link copied to clipboard
fun LocalDateTime.localizeRelativeDateAbsoluteTimeNow(options: RelativeDateAbsoluteTimeOptions = RelativeDateAbsoluteTimeOptions(), locale: PlatformLocale = getDefaultLocale(), clock: Clock = Clock.System, timeZone: TimeZone = TimeZone.currentSystemDefault()): TickingValue<String>

Localizes this LocalDateTime relatively with respect to clock @ timeZone, with a single unit with the given options in the given locale.

Link copied to clipboard
fun Instant.localizeRelativeNow(options: RelativeInstantOptions = RelativeInstantOptions(), locale: PlatformLocale = getDefaultLocale(), clock: Clock = Clock.System, timeZone: TimeZone = TimeZone.currentSystemDefault()): TickingValue<String>

Localizes this Instant relatively with respect to clock @ timeZone, with a single unit with the given options in the given locale.

fun LocalDate.localizeRelativeNow(options: RelativeLocalDateOptions = RelativeLocalDateOptions(), locale: PlatformLocale = getDefaultLocale(), clock: Clock = Clock.System, timeZone: TimeZone = TimeZone.currentSystemDefault()): TickingValue<String>

Localizes this LocalDate relatively with respect to clock @ timeZone, with a single unit with the given options in the given locale.

fun YearMonth.localizeRelativeNow(options: RelativeYearMonthOptions = RelativeYearMonthOptions(), locale: PlatformLocale = getDefaultLocale(), clock: Clock = Clock.System, timeZone: TimeZone = TimeZone.currentSystemDefault()): TickingValue<String>

Localizes this YearMonth relatively with respect to clock @ timeZone, with a single unit with the given options in the given locale.