rememberCalendarDatePickerState

fun rememberCalendarDatePickerState(today: LocalDate, initialSelectedDate: LocalDate? = null, dateFormat: DateTimeFormat<LocalDate> = LocalDate.Format { year(); char('/'); monthNumber(); char('/'); day() }, selectableDates: SelectableDates = SelectableDates { true }, onFieldValidation: (Boolean?) -> Unit = {}): CalendarDatePickerState

Creates a CalendarDatePickerState that is remembered across compositions.

Parameters

today

The current day represented by a LocalDate.

initialSelectedDate

The initial LocalDate to be selected, or null if no date is selected.

dateFormat

The DateTimeFormat used to parse and format the date string. Defaults to yyyy/MM/dd.

selectableDates

A SelectableDates instance that determines which dates are selectable. Defaults to all dates being selectable.

onFieldValidation

Callback invoked when the state tries to parse the field value or format the CalendarDatePickerState.selectedDate when one of them is changed. Returns true when successful, false otherwise, or null if the field is empty.