YearMonthPickerState

class YearMonthPickerState(initialYear: Int, initialMonth: Int)

State holder for the YearMonthPicker.

Manages the selected year and month.

Parameters

initialYear

The initial year to be selected. Must be in 1000..9999.

initialMonth

The initial month to be selected.

Throws

if initialYear or initialMonth is outside the supported range.

Constructors

Link copied to clipboard
constructor(initialYear: Int, initialMonth: Int)
constructor(initialYearMonth: YearMonth)

Creates a YearMonthPickerState from initialYearMonth.

constructor(initialDate: LocalDate)

Creates a YearMonthPickerState from the year/month portion of initialDate.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The currently selected month (1-12).

Link copied to clipboard
val selectedMonthDate: LocalDate

The selected year and month represented as the first day of that month.

Link copied to clipboard

The currently selected year.

Link copied to clipboard

The selected year/month value.

Functions

Link copied to clipboard
fun selectDate(date: LocalDate)

Programmatically selects the year and month from date.

fun selectDate(date: LocalDate, items: YearMonthPickerItems)

Programmatically selects the closest year/month to date that is allowed by items.

Link copied to clipboard
fun selectYearMonth(yearMonth: YearMonth)

Programmatically selects yearMonth.

Programmatically selects the closest year/month to yearMonth that is allowed by items.

fun selectYearMonth(year: Int, month: Int)

Programmatically selects year and month.

fun selectYearMonth(year: Int, month: Int, items: YearMonthPickerItems)

Programmatically selects the closest year/month to year and month that is allowed by items.