rememberYearMonthPickerState

Creates and remembers a YearMonthPickerState from a YearMonth. Initial year and month are read when the state is first created.

Return

A YearMonthPickerState initialized with initialYearMonth.

Parameters

initialYearMonth

The initial year/month value to select.


fun rememberYearMonthPickerState(initialDate: LocalDate = currentDate()): YearMonthPickerState

Creates and remembers a YearMonthPickerState from a LocalDate. Initial year and month are read when the state is first created.

The day value is ignored because YearMonthPicker only selects year and month.

Return

A YearMonthPickerState initialized with the year and month from initialDate.

Parameters

initialDate

The initial date whose year and month should be selected. Defaults to the current date.

Throws

if initialDate's year is outside the supported 1000..9999 range.


Creates and remembers a YearMonthPickerState whose initial YearMonth is coerced by items.

Initial values and items are read when the state is first created. This is useful when the picker is rendered with custom item lists or year/month bounds and restored app state may fall outside those rules.

Return

A YearMonthPickerState initialized to the closest selectable year/month.

Parameters

items

Selectable values used to coerce initialYearMonth before creating the state.

initialYearMonth

The requested initial year/month.


fun rememberYearMonthPickerState(items: YearMonthPickerItems, initialDate: LocalDate = currentDate()): YearMonthPickerState

Creates and remembers a YearMonthPickerState whose initial year/month is coerced by items.

Initial values and items are read when the state is first created. The day value of initialDate is ignored because YearMonthPicker only selects year and month. This is useful when the picker is rendered with custom item lists or year/month bounds and restored app state may fall outside those rules.

Return

A YearMonthPickerState initialized to the closest selectable year/month.

Parameters

items

Selectable values used to coerce initialDate before creating the state.

initialDate

The requested initial date.


Creates and remembers a YearMonthPickerState with explicit year and month values. Initial year and month are read when the state is first created.

Return

A YearMonthPickerState initialized with the given year and month.

Parameters

initialYear

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

initialMonth

The initial month to be selected. Must be in 1..12.


Creates and remembers a YearMonthPickerState whose explicit initial year/month is coerced by items.

Return

A YearMonthPickerState initialized to the closest selectable year/month.

Parameters

items

Selectable values used to coerce initialYear and initialMonth.

initialYear

The requested initial year.

initialMonth

The requested initial month.