> 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/de/apps/components/inputs/date-picker.md).

# Date Picker

Datumsauswahlen bieten eine einfache Möglichkeit, einen einzelnen Wert aus einer vorgegebenen Menge auszuwählen.

Datumsauswahlen können in [Formularen](/powershell-universal/de/apps/components/inputs/form.md) und [Steppern](/powershell-universal/de/apps/components/navigation/stepper.md) verwendet werden.

![](/files/DEqI5yMW27kO5EillgzJ)

```powershell
New-UDDatePicker
```

## OnChange-Event-Handler

Der OnChange-Event-Handler wird aufgerufen, wenn sich das Datum ändert. Sie können auf das aktuelle Datum über die Variable `$Body` zugreifen.

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

## Variante

Sie können anpassen, wie die Datumsauswahl angezeigt wird. Standard ist die Variante `inline`, die das Popup der Datumsauswahl in einer Linie mit dem Eingabesteuerelement anzeigt. Die Variante `static` zeigt die Datumsauswahl an, ohne dass etwas angeklickt werden muss.

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

## Locale

Um das Locale der Datumsauswahl festzulegen, geben Sie den Parameter `-Locale` an.

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

![](/files/IEcsRJSzmX2vmJBenXz4)

## Minimum und Maximum

Standardmäßig kann der Benutzer ein beliebiges Datum auswählen. Um minimale und maximale Datumsangaben festzulegen, verwenden Sie die Parameter `-Minimum` und `-Maximum`.

```powershell
New-UDDatePicker -Minimum ((Get-Date).AddDays(-15)) -Maximum ((Get-Date).AddDays(15))
```

## Ansichten

Sie können mit dem Parameter `-Views` einschränken, welche Teile der Datumsauswahl enthalten sind. Wenn Sie zum Beispiel die Jahresauswahl entfernen und auf das aktuelle Jahr beschränken möchten, könnten Sie Folgendes tun.

```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/de/powershell-befehle/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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
