DateRange

data class DateRange(val startDate: LocalDate, val endDate: LocalDate)

Inclusive date range selected by DateRangePicker. Use ordered when app-owned start/end inputs may arrive in either order.

Parameters

startDate

The first selected date.

endDate

The last selected date.

Throws

if startDate is after endDate.

Constructors

Link copied to clipboard
constructor(startDate: LocalDate, endDate: LocalDate)
constructor(startYear: Int, startMonth: Int, startDay: Int, endYear: Int = startYear, endMonth: Int = startMonth, endDay: Int = startDay)

Creates a DateRange with explicit start and end date parts.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Number of calendar days in this inclusive range.

Link copied to clipboard
val endDate: LocalDate
Link copied to clipboard

Returns whether this range selects exactly one calendar day.

Link copied to clipboard
val startDate: LocalDate

Functions

Link copied to clipboard
operator fun contains(range: DateRange): Boolean

Returns whether range is fully inside this inclusive range.

operator fun contains(date: LocalDate): Boolean

Returns whether date is inside this inclusive range.

fun contains(year: Int, month: Int, day: Int): Boolean

Returns whether year, month, and day are inside this inclusive range.

Link copied to clipboard

Returns the inclusive overlap between this range and range, or null when they do not share any calendar day.

Link copied to clipboard

Returns whether this inclusive range and range share at least one calendar day.