Verdandi Relative Moment
Represents the result of comparing two VerdandiMoment instances, expressing their temporal distance as a human-readable relative description.
A VerdandiRelativeMoment is one of three cases:
Now — the two moments are identical (zero distance).
Past — the reference moment is before the target moment.
Future — the reference moment is after the target moment.
Use format to produce a localized string from the relative moment:
val relative: VerdandiRelativeMoment = momentA.relative(momentB)
val text = relative format {
onNow { "just now" }
onPast { diff -> "$diff ago" }
onFuture { diff -> "in $diff" }
}Content copied to clipboard