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

# Datovælger

Tilføj datovælgere til PowerShell Universal-apps og -formularer med landestandard, minimums- og maksimumsdatointervaller og konfigurerbare inline- eller statiske visninger.

Datovælgere giver en enkel måde at vælge en enkelt værdi fra et forudbestemt sæt.

Datovælgere kan bruges i [Forms](/powershell-universal/da/apps/components/inputs/form.md) og [Steppers](/powershell-universal/da/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-hændelseshandler

OnChange-hændelseshandleren kaldes, når datoen ændres. De kan få adgang til den aktuelle dato ved hjælp af variablen `$Body`.

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

## Variant

De kan tilpasse, hvordan datovælgeren vises. Standarden er varianten `inline`, der viser datovælgerens pop op-vindue på linje med inputkontrolelementet. Varianten `static` viser datovælgeren, uden at der skal klikkes på noget.

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

## Landestandard

For at indstille landestandarden for datovælgeren skal De angive parameteren `-Locale`.

```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 og maksimum

Som standard kan brugeren vælge en hvilken som helst dato. Brug parametrene `-MinimumDate` og `-MaximumDate` for at angive minimums- og maksimumsdatoer.

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

## Visninger

De kan begrænse, hvilke dele af datovælgeren der medtages, ved at bruge parameteren `-Views`. Hvis De f.eks. vil fjerne årsvælgeren og begrænse til det aktuelle år, kan De gøre følgende.

```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/da/powershell-kommandoer/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/da/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.
