androidx.compose.material3
rememberDateRangePickerState
Function
No hand-written docs yet.
Creates a DateRangePickerState for a DateRangePicker that is remembered across compositions.
Parameters
@Composable
fun rememberDateRangePickerState(
initialSelectedStartDateMillis: Long? = null,
initialSelectedEndDateMillis: Long? = null,
initialDisplayedMonthMillis: Long? = initialSelectedStartDateMillis,
yearRange: IntRange = DatePickerDefaults.YearRange,
initialDisplayMode: DisplayMode = DisplayMode.Picker,
selectableDates: SelectableDates = DatePickerDefaults.AllDates,
): DateRangePickerState
initialSelectedStartDateMillis: Long?Optional
initialSelectedStartDateMillis: Long?OptionalDefault: null
timestamp in UTC milliseconds from the epoch that represents an initial selection of a start date. Provide a null to indicate no selection.
initialSelectedEndDateMillis: Long?Optional
initialSelectedEndDateMillis: Long?OptionalDefault: null
timestamp in UTC milliseconds from the epoch that represents an initial selection of an end date. Provide a null to indicate no selection.
initialDisplayedMonthMillis: Long?Optional
initialDisplayedMonthMillis: Long?OptionalDefault: initialSelectedStartDateMillis
timestamp in UTC milliseconds from the epoch that represents an initial selection of a month to be displayed to the user. By default, in case an initialSelectedStartDateMillis is provided, the initial displayed month would be the month of the selected date. Otherwise, in case null is provided, the displayed month would be the current one.
yearRange: IntRangeOptional
yearRange: IntRangeOptionalDefault: DatePickerDefaults.YearRange
an IntRange that holds the year range that the date range picker will be limited to
initialDisplayMode: DisplayModeOptional
initialDisplayMode: DisplayModeOptionalDefault: DisplayMode.Picker
an initial DisplayMode that this state will hold
selectableDates: SelectableDatesOptional
selectableDates: SelectableDatesOptionalDefault: DatePickerDefaults.AllDates
a SelectableDates that is consulted to check if a date is allowed. In case a date is not allowed to be selected, it will appear disabled in the UI.
Library docs
Creates a DateRangePickerState for a DateRangePicker that is remembered across compositions.
To create a date range picker state outside composition, see the DateRangePickerState function.