YearMonthPickerItems

data class YearMonthPickerItems(val yearItems: List<Int>, val monthItems: List<Int>, val constraints: YearMonthPickerConstraints = YearMonthPickerConstraints())

Selectable item lists for io.github.kezlab.compose.pickers.date.YearMonthPicker.

Lists must be non-empty, contain distinct values, stay within their documented ranges, and contain the current state selection. constraints are applied after year and month item lists. Treat item lists as immutable after passing them to a picker; create a new YearMonthPickerItems when available values change.

Parameters

yearItems

Year values available for selection. Values must be in 1000..9999.

monthItems

Month values available for selection. Values must be in 1..12.

constraints

Inclusive year/month bounds applied after the year and month item lists.

See also

Constructors

Link copied to clipboard
constructor(yearItems: List<Int>, monthItems: List<Int>, constraints: YearMonthPickerConstraints = YearMonthPickerConstraints())

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun coerceDate(date: LocalDate): LocalDate

Returns the closest selectable YearMonth for the year/month portion of date.

Link copied to clipboard

Returns the closest selectable YearMonth for yearMonth.

fun coerceYearMonth(year: Int, month: Int): YearMonth

Returns the closest selectable YearMonth for year and month.

Link copied to clipboard
fun contains(yearMonth: YearMonth): Boolean

Returns whether yearMonth is directly selectable.

fun contains(date: LocalDate): Boolean

Returns whether the year/month portion of date is directly selectable.

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

Returns whether year and month are directly selectable.