androidx.compose.material3

DateRangePickerState

Interface

No hand-written docs yet.

A state object that can be hoisted to observe the date range picker state. See rememberDateRangePickerState.

interface DateRangePickerState

How to get one

Create it

Ready-made values and functions that return it

Used by

Parameters that take a DateRangePickerState.

Properties

selectedStartDateMillis

val selectedStartDateMillis: Long?

A timestamp that represents the selected start date start of the day in UTC milliseconds from the epoch.

selectedEndDateMillis

val selectedEndDateMillis: Long?

A timestamp that represents the selected end date start of the day in UTC milliseconds from the epoch.

displayedMonthMillis

val displayedMonthMillis: Long

A timestamp that represents the currently displayed month start date in UTC milliseconds from the epoch.

displayMode

val displayMode: DisplayMode

A DisplayMode that represents the current UI mode (i.e. picker or input).

yearRange

val yearRange: IntRange

An IntRange that holds the year range that the date picker will be limited to.

selectableDates

val selectableDates: SelectableDates

A SelectableDates that is consulted to check if a date is allowed.

localeSince 1.9

val locale: CalendarLocale

A locale that will be used when formatting dates, determining the input format, week-days, and more.

Functions

setSelection

fun setSelection(startDateMillis: Long?, endDateMillis: Long?)

Sets a start and end selection dates.

Library docs

A state object that can be hoisted to observe the date range picker state. See rememberDateRangePickerState.