Package-level declarations

Types

Link copied to clipboard
class RelativeDateAbsoluteTimeLocalizer(options: RelativeDateAbsoluteTimeOptions = RelativeDateAbsoluteTimeOptions(), locale: PlatformLocale = getDefaultLocale()) : PolyglotReferenceValueLocalizer<LocalDateTime>

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

Link copied to clipboard
data class RelativeDateAbsoluteTimeOptions(val dateOptions: RelativeLocalDateOptions = RelativeLocalDateOptions(), val timeOptions: LocalTimeOptions, val joinerStyle: DateStyle = DateStyle.LONG)
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 } })
Link copied to clipboard
class RelativeInstantLocalizer(options: RelativeInstantOptions = RelativeInstantOptions(), locale: PlatformLocale = getDefaultLocale()) : PolyglotReferenceValueLocalizer<Instant>

Localizes an Instant relative to another one.

Link copied to clipboard
class RelativeLocalDateLocalizer(options: RelativeLocalDateOptions = RelativeLocalDateOptions(), val locale: PlatformLocale = getDefaultLocale()) : PolyglotReferenceValueLocalizer<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
Link copied to clipboard
class RelativeYearLocalizer(options: RelativeYearOptions = RelativeYearOptions(), locale: PlatformLocale = getDefaultLocale()) : PolyglotReferenceValueLocalizer<Int>

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

Link copied to clipboard
class RelativeYearMonthLocalizer(options: RelativeYearMonthOptions = RelativeYearMonthOptions(), locale: PlatformLocale = getDefaultLocale()) : PolyglotReferenceValueLocalizer<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
Link copied to clipboard
data class RelativeYearOptions(val style: RelativeUnitStyle = RelativeUnitStyle.LONG, val allowedDirections: Set<RelativeDirection> = RelativeDirection.entries.toSet()) : RelativeUnitOptions

Localization options for RelativeYearLocalizer.

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(options: RelativeInstantOptions = RelativeInstantOptions(), locale: PlatformLocale = getDefaultLocale(), clock: Clock = Clock.System): TickingValue<String>

Localizes this Instant relatively with respect to clock, 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 LocalDate.localizeRelative(options: RelativeLocalDateOptions = RelativeLocalDateOptions(), locale: PlatformLocale = getDefaultLocale(), clock: Clock = Clock.System): TickingValue<String>

Localizes this LocalDate relatively with respect to clock, 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.

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

Localizes this YearMonth relatively with respect to clock, 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: Clock = Clock.System): Flow<String>

Localizes this Instant relatively with respect to clock, 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: Clock = Clock.System): Flow<String>

Localizes this LocalDate relatively with respect to clock, 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: Clock = Clock.System): Flow<String>

Localizes this YearMonth relatively with respect to clock, 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.

fun LocalDateTime.localizeRelativeDateAbsoluteTime(options: RelativeDateAbsoluteTimeOptions = RelativeDateAbsoluteTimeOptions(), locale: PlatformLocale = getDefaultLocale(), clock: Clock = Clock.System): TickingValue<String>

Localizes this LocalDateTime relatively with respect to clock, 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: Clock = Clock.System): Flow<String>

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