---
title: "DateRangePickerState"
description: "A state object that can be hoisted to observe the date range picker state. See
[rememberDateRangePickerState]."
type: "interface"
---

<div class='type'>Interface</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>



```kotlin
interface DateRangePickerState
```


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


## Properties

<div class='sourceset sourceset-common'>Common</div>


```kotlin
val selectedStartDateMillis: Long?
```


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



<div class='sourceset sourceset-common'>Common</div>


```kotlin
val selectedEndDateMillis: Long?
```


A timestamp that represents the selected end date _start_ of the day in _UTC_ milliseconds
from the epoch.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
var displayedMonthMillis: Long
```


A timestamp that represents the currently displayed month _start_ date in _UTC_ milliseconds
from the epoch.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
var displayMode: DisplayMode
```


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



<div class='sourceset sourceset-common'>Common</div>


```kotlin
val yearRange: IntRange
```


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



<div class='sourceset sourceset-common'>Common</div>


```kotlin
val selectableDates: SelectableDates
```


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.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
val locale: CalendarLocale
```


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



## Functions

```kotlin
fun setSelection(
        @Suppress("AutoBoxing") startDateMillis: Long?,
        @Suppress("AutoBoxing") endDateMillis: Long?,
    )
```


Sets a start and end selection dates.

The function expects the dates to be within the state's year-range, and for the start date to
appear before, or be equal, the end date. Also, if an end date is provided (e.g. not `null`),
a start date is also expected to be provided. In any other case, an
`IllegalArgumentException` is thrown.

#### Parameters

| | |
| --- | --- |
| startDateMillis | timestamp in _UTC_ milliseconds from the epoch that represents the start date selection. Provide a `null` to indicate no selection. |
| endDateMillis | timestamp in _UTC_ milliseconds from the epoch that represents the end date selection. Provide a `null` to indicate no selection. |




