Verdandi Interval
@Serializable
A half-open time interval [start, end) between two VerdandiMoment instances.
Intervals are always normalized so that start ≤ end. They can be created through the com.github.abraga.verdandi.Verdandi entry point:
val recent = Verdandi.interval { last thirty days }
val custom = Verdandi.interval("2025-01-01T00:00:00Z", "2025-12-31T23:59:59Z")
val range = Verdandi.interval(startMs..endMs)Content copied to clipboard
Operations
Intervals expose set-like operations and duration computation through VerdandiIntervalOperationScope:
interval.contains(moment)
interval.overlaps(other)
interval.intersection(other)
interval.union(other)
interval.duration() // DateTimeDurationContent copied to clipboard
Adjustments
The adjust DSL allows shifting, expanding, shrinking, and aligning interval bounds:
val adjusted = interval adjust {
shiftBoth(2.hours)
alignToFullDays()
}Content copied to clipboard
Factory access
An interval also implements VerdandiFromMomentFactoryScope, allowing creation of moments relative to it:
val midpoint = interval.at(
year = 2025, month = 6, day = 15
)Content copied to clipboard
Properties
Functions
Link copied to clipboard
Adjusts this interval using the interval-specific DSL.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard