selectDate

fun selectDate(date: LocalDate)

Programmatically selects date.

The year, month, and day fields are applied together as one logical state update.

Throws

if date's year is outside the supported range.


fun selectDate(year: Int, month: Int, day: Int)

Programmatically selects year, month, and day.

If day is greater than the maximum day for year and month, it is clamped to that maximum, matching DatePickerState initialization behavior.

Throws

if year or month is outside the supported range, or if day is less than 1.


fun selectDate(date: LocalDate, items: DatePickerItems)

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

Use this overload when app-owned state can contain values outside custom picker lists or date bounds.


fun selectDate(year: Int, month: Int, day: Int, items: DatePickerItems)

Programmatically selects the closest date to year, month, and day that is allowed by items.

If day is greater than the maximum day for year and month, it is clamped before applying items.