# Date Picker

Date pickers pickers provide a simple way to select a single value from a pre-determined set.

Date pickers can be used in [Forms](https://docs.powershelluniversal.com/master-1/userinterfaces/dashboards/components/inputs/form) and [Steppers](https://docs.powershelluniversal.com/master-1/userinterfaces/dashboards/components/navigation/stepper).

![](https://3638551245-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6jY7sXTmhiAIMGYw_m%2F-MAgA8lkflyE8DVzEwHy%2F-MAgAdTcQRqqTqnMntHe%2Fimage.png?alt=media\&token=519b7d18-018e-4b00-a80d-a8ed24de2a67)

```powershell
New-UDDatePicker
```

## OnChange Event Handler

The OnChange event handler is called when the date changes. You can access the current date by using the `$Body` variable.

```powershell
New-UDDatePicker -OnChange {
    Show-UDToast -Message $body
}
```

## Variant

You can customize how the date picker is show. The default is the `inline` variant that displays the date picker popup inline with the input control. You can also use the `dialog` variant that pops the date picker up in the middle of the screen. Finally, the `static` variant displays the date picker without having to click anything.

```powershell
New-UDDatePicker -Variant static
```

## Locale

To set the locate of the date picker, specify the `-Locale` parameter.&#x20;

```powershell
New-UDDatePicker -Locale fr
```

![](https://3638551245-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6jY7sXTmhiAIMGYw_m%2F-Mj0Q-DlkN00XHNrKcvt%2F-Mj0QTHvHhUW68Iby8ec%2Fimage.png?alt=media\&token=dccfb2a1-db44-41fd-aa83-ed7759a31a7d)

## API

* [New-UDDatePicker](https://github.com/ironmansoftware/universal-docs/blob/master/cmdlets/New-UDDatePicker.txt)
