rememberDateRangePickerState

fun rememberDateRangePickerState(initialStartDate: LocalDate = currentDate(), initialEndDate: LocalDate = initialStartDate): DateRangePickerState

Creates and remembers a DateRangePickerState.

Initial values are read when the state is first created.

Return

A DateRangePickerState initialized with the requested date range.

Parameters

initialStartDate

The initial range start date.

initialEndDate

The initial range end date.


Creates and remembers a DateRangePickerState from an initial DateRange.

Initial values are read when the state is first created.

Return

A DateRangePickerState initialized with initialDateRange.

Parameters

initialDateRange

The initial range to be selected.


fun rememberDateRangePickerState(initialStartYear: Int, initialStartMonth: Int, initialStartDay: Int, initialEndYear: Int = initialStartYear, initialEndMonth: Int = initialStartMonth, initialEndDay: Int = initialStartDay): DateRangePickerState

Creates and remembers a DateRangePickerState with explicit start and end date parts.

Initial values are read when the state is first created. If a day is greater than the maximum day for its year/month, it is clamped to that maximum.

Return

A DateRangePickerState initialized with the requested date range.

Parameters

initialStartYear

The initial range start year. Must be in 1000..9999.

initialStartMonth

The initial range start month. Must be in 1..12.

initialStartDay

The initial range start day. Must be at least 1.

initialEndYear

The initial range end year. Must be in 1000..9999.

initialEndMonth

The initial range end month. Must be in 1..12.

initialEndDay

The initial range end day. Must be at least 1.


fun rememberDateRangePickerState(items: DatePickerItems, initialStartDate: LocalDate = currentDate(), initialEndDate: LocalDate = initialStartDate): DateRangePickerState

Creates and remembers a DateRangePickerState whose initial values are coerced by items.

Initial values and items are read when the state is first created. This overload accepts unordered initialStartDate and initialEndDate values. Both dates are coerced by items and then ordered before the state is created.

Return

A DateRangePickerState initialized to the closest selectable date range.

Parameters

items

Selectable values used to coerce initialStartDate and initialEndDate.

initialStartDate

The requested range start date.

initialEndDate

The requested range end date.


Creates and remembers a DateRangePickerState from an initial DateRange coerced by items.

Initial values and items are read when the state is first created.

Return

A DateRangePickerState initialized to the closest selectable date range.

Parameters

items

Selectable values used to coerce initialDateRange.

initialDateRange

The requested initial range.


fun rememberDateRangePickerState(items: DatePickerItems, initialStartYear: Int, initialStartMonth: Int, initialStartDay: Int, initialEndYear: Int = initialStartYear, initialEndMonth: Int = initialStartMonth, initialEndDay: Int = initialStartDay): DateRangePickerState

Creates and remembers a DateRangePickerState with explicit start and end date parts coerced by items.

Initial values and items are read when the state is first created. If a day is greater than the maximum day for its year/month, it is clamped before items coercion. This overload accepts unordered resulting dates and orders them before the state is created.

Return

A DateRangePickerState initialized to the closest selectable date range.

Parameters

items

Selectable values used to coerce the requested start and end dates.

initialStartYear

The requested range start year.

initialStartMonth

The requested range start month.

initialStartDay

The requested range start day.

initialEndYear

The requested range end year.

initialEndMonth

The requested range end month.

initialEndDay

The requested range end day.