> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/apps/components/inputs/date-picker.md).

# Date Picker

Add date pickers to PowerShell Universal apps and forms with locale, minimum and maximum date ranges, and configurable inline or static views.

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

Date pickers can be used in [Forms](/powershell-universal/apps/components/inputs/form.md) and [Steppers](/powershell-universal/apps/components/navigation/stepper.md).

![](https://218893503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAje1UFQFSPx2kH2ueeCf%2Fuploads%2Fgit-blob-f3edbbf5201b7255fc7fbc71428f646e09dda1f9%2Fimage%20\(81\).png?alt=media)

```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 shown. The default is the `inline` variant that displays the date picker popup in line with the input control. The `static` variant displays the date picker without having to click anything.

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

## Locale

To set the locale of the date picker, specify the `-Locale` parameter.

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

![](https://218893503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAje1UFQFSPx2kH2ueeCf%2Fuploads%2Fgit-blob-eb4620921950267db9982cbfbfc66884abd5ecf3%2Fimage%20\(50\).png?alt=media)

## Minimum and Maximum

By default, the user can select any date. To specify minimum and maximum dates, use the `-MinimumDate` and `-MaximumDate` parameters.

```powershell
New-UDDatePicker -MinimumDate ((Get-Date).AddDays(-15)) -MaximumDate ((Get-Date).AddDays(15))
```

## Views

You can limit which portions of the date picker are included by using the `-Views` parameter. For example, if you wanted to remove the year selector and limit to the current year, you could do the following.

```powershell
$Year = (Get-Date).Year
$MinDate = [DateTime]::new($year, 1, 1)
$MaxDate = [DateTime]::new($year, 12, 31)
New-UDDatePicker -Views "day" -MinimumDate $MinDate -MaximumDate $MaxDate
```

## API

* [New-UDDatePicker](/powershell-universal/powershell-commands/new-uddatepicker.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/powershell-universal/apps/components/inputs/date-picker.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
