# MaterialDatePickerState

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-themes-material/struct-materialdatepickerstate/

**struct** · [`ferroui-themes-material`](/docs/0.5.0/api/ferroui-themes-material/) · v0.5.0

```rust
struct MaterialDatePickerState
```

A restorable native selection snapshot. End dates are inclusive. An incomplete range
has a start and no end; an invalid or reversed programmatic range clears both ends.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/date_picker_state.rs#L31)

## Members

- [`selected_start`](#struct_field-selected_start)
- [`selected_end`](#struct_field-selected_end)
- [`displayed_month`](#struct_field-displayed_month)
- [`mode`](#struct_field-mode)
- [`selection_mode`](#struct_field-selection_mode)
- [`first_year`](#struct_field-first_year)
- [`last_year`](#struct_field-last_year)
- [`canonical_date`](#function-canonical_date)
- [`contains_year`](#function-contains_year)
- [`set_selection`](#function-set_selection)
- [`select_date`](#function-select_date)
- [`set_displayed_month`](#function-set_displayed_month)
- [`set_mode`](#function-set_mode)
- [`set_year_range`](#function-set_year_range)
- [`is_in_range`](#function-is_in_range)
- [`is_complete`](#function-is_complete)
- [`month_index`](#function-month_index)
- [`month_count`](#function-month_count)
- [`month_at`](#function-month_at)

<a id="struct_field-selected_start"></a>

### selected_start

```rust
selected_start: Option<ferroui_base::utilities::DateTime>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/date_picker_state.rs#L32)

<a id="struct_field-selected_end"></a>

### selected_end

```rust
selected_end: Option<ferroui_base::utilities::DateTime>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/date_picker_state.rs#L33)

<a id="struct_field-displayed_month"></a>

### displayed_month

```rust
displayed_month: ferroui_base::utilities::DateTime
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/date_picker_state.rs#L34)

<a id="struct_field-mode"></a>

### mode

```rust
mode: MaterialDatePickerMode
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/date_picker_state.rs#L35)

<a id="struct_field-selection_mode"></a>

### selection_mode

```rust
selection_mode: MaterialDateSelectionMode
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/date_picker_state.rs#L36)

<a id="struct_field-first_year"></a>

### first_year

```rust
first_year: i32
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/date_picker_state.rs#L37)

<a id="struct_field-last_year"></a>

### last_year

```rust
last_year: i32
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/date_picker_state.rs#L38)

<a id="function-canonical_date"></a>

### canonical_date

```rust
fn canonical_date(self: &Self, date: Option<DateTime>) -> Option<DateTime>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/date_picker_state.rs#L54)

<a id="function-contains_year"></a>

### contains_year

```rust
fn contains_year(self: &Self, year: i32) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/date_picker_state.rs#L57)

<a id="function-set_selection"></a>

### set_selection

```rust
fn set_selection(self: &mut Self, start: Option<DateTime>, end: Option<DateTime>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/date_picker_state.rs#L60)

<a id="function-select_date"></a>

### select_date

```rust
fn select_date(self: &mut Self, date: DateTime)
```

Call only after checking the date and year selection policy. Range selection does
not require every intervening day to be selectable, matching the native picker.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/date_picker_state.rs#L77)

<a id="function-set_displayed_month"></a>

### set_displayed_month

```rust
fn set_displayed_month(self: &mut Self, date: DateTime)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/date_picker_state.rs#L92)

<a id="function-set_mode"></a>

### set_mode

```rust
fn set_mode(self: &mut Self, mode: MaterialDatePickerMode)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/date_picker_state.rs#L97)

<a id="function-set_year_range"></a>

### set_year_range

```rust
fn set_year_range(self: &mut Self, first: i32, last: i32)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/date_picker_state.rs#L103)

<a id="function-is_in_range"></a>

### is_in_range

```rust
fn is_in_range(self: &Self, date: DateTime) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/date_picker_state.rs#L117)

<a id="function-is_complete"></a>

### is_complete

```rust
fn is_complete(self: &Self) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/date_picker_state.rs#L122)

<a id="function-month_index"></a>

### month_index

```rust
fn month_index(self: &Self, month: DateTime) -> i32
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/date_picker_state.rs#L127)

<a id="function-month_count"></a>

### month_count

```rust
fn month_count(self: &Self) -> i32
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/date_picker_state.rs#L130)

<a id="function-month_at"></a>

### month_at

```rust
fn month_at(self: &Self, index: i32) -> DateTime
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/date_picker_state.rs#L133)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Equivalent<K>`
- `CastableFrom<ST, Uninit, Uninit>`
- `CastableFrom<ST, Initialized, Initialized>`
- `Read<Exclusive, BecauseExclusive>`
- `Clone`
- `Copy`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`
- `Default`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
