# DatePicker

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/date_time_pickers/struct-datepicker/

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

```rust
struct DatePicker
```

A control to allow the user to select a date.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L33)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`on_selected_date_changed`](#function-on_selected_date_changed)
- [`day_format_property`](#function-day_format_property)
- [`day_visible_property`](#function-day_visible_property)
- [`max_year_property`](#function-max_year_property)
- [`min_year_property`](#function-min_year_property)
- [`month_format_property`](#function-month_format_property)
- [`month_visible_property`](#function-month_visible_property)
- [`year_format_property`](#function-year_format_property)
- [`year_visible_property`](#function-year_visible_property)
- [`vertical_content_alignment_property`](#function-vertical_content_alignment_property)
- [`selected_date_property`](#function-selected_date_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`vertical_content_alignment`](#function-vertical_content_alignment)
- [`set_vertical_content_alignment`](#function-set_vertical_content_alignment)
- [`day_format`](#function-day_format)
- [`set_day_format`](#function-set_day_format)
- [`day_visible`](#function-day_visible)
- [`set_day_visible`](#function-set_day_visible)
- [`max_year`](#function-max_year)
- [`set_max_year`](#function-set_max_year)
- [`min_year`](#function-min_year)
- [`set_min_year`](#function-set_min_year)
- [`month_format`](#function-month_format)
- [`set_month_format`](#function-set_month_format)
- [`month_visible`](#function-month_visible)
- [`set_month_visible`](#function-set_month_visible)
- [`year_format`](#function-year_format)
- [`set_year_format`](#function-set_year_format)
- [`year_visible`](#function-year_visible)
- [`set_year_visible`](#function-set_year_visible)
- [`selected_date`](#function-selected_date)
- [`set_selected_date`](#function-set_selected_date)
- [`selected_date_changed`](#function-selected_date_changed)
- [`clear`](#function-clear)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L58)

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

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<DatePicker>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L58)

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

### on_selected_date_changed

```rust
fn on_selected_date_changed(self: &Self, e: &DatePickerSelectedValueChangedEventArgs)
```

Raises the `SelectedDateChanged` event.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L58)

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

### day_format_property

```rust
fn day_format_property() -> &'static StyledProperty<String>
```

Defines the `DayFormat` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L232)

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

### day_visible_property

```rust
fn day_visible_property() -> &'static StyledProperty<bool>
```

Defines the `DayVisible` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L232)

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

### max_year_property

```rust
fn max_year_property() -> &'static StyledProperty<DateTimeOffset>
```

Defines the `MaxYear` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L232)

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

### min_year_property

```rust
fn min_year_property() -> &'static StyledProperty<DateTimeOffset>
```

Defines the `MinYear` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L232)

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

### month_format_property

```rust
fn month_format_property() -> &'static StyledProperty<String>
```

Defines the `MonthFormat` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L232)

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

### month_visible_property

```rust
fn month_visible_property() -> &'static StyledProperty<bool>
```

Defines the `MonthVisible` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L232)

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

### year_format_property

```rust
fn year_format_property() -> &'static StyledProperty<String>
```

Defines the `YearFormat` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L232)

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

### year_visible_property

```rust
fn year_visible_property() -> &'static StyledProperty<bool>
```

Defines the `YearVisible` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L232)

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

### vertical_content_alignment_property

```rust
fn vertical_content_alignment_property() -> &'static StyledProperty<VerticalAlignment>
```

Defines the `VerticalContentAlignment` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L232)

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

### selected_date_property

```rust
fn selected_date_property() -> &'static StyledProperty<Option<DateTimeOffset>>
```

Defines the `SelectedDate` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L232)

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

### construct

```rust
fn construct() -> Self
```

Creates the class data; see `ferroui_base::FerroObject::construct`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L299)

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

### new

```rust
fn new() -> Ref<Self>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L318)

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

### vertical_content_alignment

```rust
fn vertical_content_alignment(self: &Self) -> VerticalAlignment
```

The vertical alignment of the content within the control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L323)

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

### set_vertical_content_alignment

```rust
fn set_vertical_content_alignment(self: &Self, value: VerticalAlignment)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L327)

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

### day_format

```rust
fn day_format(self: &Self) -> String
```

The format of the day.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L332)

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

### set_day_format

```rust
fn set_day_format(self: &Self, value: &str)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L336)

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

### day_visible

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

Whether the day is visible.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L341)

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

### set_day_visible

```rust
fn set_day_visible(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L345)

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

### max_year

```rust
fn max_year(self: &Self) -> DateTimeOffset
```

The maximum year for the picker.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L350)

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

### set_max_year

```rust
fn set_max_year(self: &Self, value: DateTimeOffset)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L354)

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

### min_year

```rust
fn min_year(self: &Self) -> DateTimeOffset
```

The minimum year for the picker.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L373)

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

### set_min_year

```rust
fn set_min_year(self: &Self, value: DateTimeOffset)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L377)

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

### month_format

```rust
fn month_format(self: &Self) -> String
```

The month format.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L396)

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

### set_month_format

```rust
fn set_month_format(self: &Self, value: &str)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L400)

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

### month_visible

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

Whether the month is visible.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L405)

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

### set_month_visible

```rust
fn set_month_visible(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L409)

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

### year_format

```rust
fn year_format(self: &Self) -> String
```

The year format.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L414)

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

### set_year_format

```rust
fn set_year_format(self: &Self, value: &str)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L418)

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

### year_visible

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

Whether the year is visible.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L423)

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

### set_year_visible

```rust
fn set_year_visible(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L427)

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

### selected_date

```rust
fn selected_date(self: &Self) -> Option<DateTimeOffset>
```

The selected date for the picker; can be `None`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L432)

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

### set_selected_date

```rust
fn set_selected_date(self: &Self, value: Option<DateTimeOffset>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L436)

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

### selected_date_changed

```rust
fn selected_date_changed(self: &Self, handler: impl Fn(&DatePickerSelectedValueChangedEventArgs) -> () + 'static) -> Subscription
```

Raised when the selected date changes. Dropping the returned guard removes the handler;
`Subscription::detach` keeps it for the life of the picker.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L442)

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

### clear

```rust
fn clear(self: &Self)
```

Clears the selected date.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/date_picker.rs#L582)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`TemplatedControlImplExt`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimplext/)
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- [`DatePickerImplExt`](/docs/0.5.0/api/ferroui-controls/date_time_pickers/trait-datepickerimplext/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`InputElementImplExt`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimplext/)
- [`InteractiveImplExt`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimplext/)
- [`LayoutableImplExt`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimplext/)
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- [`VisualImplExt`](/docs/0.5.0/api/ferroui-base/trait-visualimplext/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<DatePicker>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)
- [`InteractiveImpl`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimpl/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`TemplatedControlImpl`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimpl/)
- [`ControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-controlimpl/)
- [`DatePickerImpl`](/docs/0.5.0/api/ferroui-controls/date_time_pickers/trait-datepickerimpl/)

## Availability

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