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

# Selettore di data

I selettori di data offrono un modo semplice per selezionare un singolo valore da un insieme predeterminato.

I selettori di data possono essere utilizzati in [Moduli](/powershell-universal/it/app/components/inputs/form.md) e [Stepper](/powershell-universal/it/app/components/navigation/stepper.md).

![](/files/Sx5QMPwrP9ni2J5njhwi)

```powershell
New-UDDatePicker
```

## Gestore dell'evento OnChange

Il gestore dell'evento OnChange viene chiamato quando la data cambia. È possibile accedere alla data corrente utilizzando la variabile `$Body`.

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

## Variante

È possibile personalizzare la modalità di visualizzazione del selettore di data. L'impostazione predefinita è la variante `inline`, che mostra il popup del selettore di data in linea con il controllo di input. La variante `static` mostra il selettore di data senza dover fare clic su nulla.

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

## Impostazioni locali

Per impostare le impostazioni locali del selettore di data, specifichi il parametro `-Locale`.

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

![](/files/W4h5qxxAbMKUI6pX6W8t)

## Minimo e massimo

Per impostazione predefinita, l'utente può selezionare qualsiasi data. Per specificare date minime e massime, utilizzi i parametri `-Minimum` e `-Maximum`.

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

## Viste

È possibile limitare quali parti del selettore di data vengono incluse utilizzando il parametro `-Views`. Ad esempio, se volesse rimuovere il selettore dell'anno e limitarsi all'anno corrente, potrebbe fare quanto segue.

```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/it/comandi-powershell/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/it/app/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.
