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

# Selector de fecha

Los selectores de fecha selectores de fecha proporcionan una forma sencilla de seleccionar un único valor de un conjunto predeterminado.

Los selectores de fecha se pueden utilizar en [formularios](/powershell-universal/es/aplicaciones/components/inputs/form.md) y [steppers](/powershell-universal/es/aplicaciones/components/navigation/stepper.md).

![](/files/bBqLo7q6iMxZuxEVJuNr)

```powershell
New-UDDatePicker
```

## Controlador de eventos OnChange

El controlador de eventos OnChange se invoca cuando cambia la fecha. Puede acceder a la fecha actual utilizando la variable `$Body`.

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

## Variante

Puede personalizar cómo se muestra el selector de fecha. El valor predeterminado es la variante `inline`, que muestra la ventana emergente del selector de fecha en línea con el control de entrada. La variante `static` muestra el selector de fecha sin tener que hacer clic en nada.

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

## Configuración regional

Para establecer la configuración regional del selector de fecha, especifique el parámetro `-Locale`.

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

![](/files/RdJBsly06hozj2j9kIw2)

## Mínimo y máximo

De forma predeterminada, el usuario puede seleccionar cualquier fecha. Para especificar fechas mínima y máxima, utilice los parámetros `-Minimum` y `-Maximum`.

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

## Vistas

Puede limitar qué partes del selector de fecha se incluyen utilizando el parámetro `-Views`. Por ejemplo, si quisiera eliminar el selector de año y limitarlo al año actual, podría hacer lo siguiente.

```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/es/comandos-de-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/es/aplicaciones/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.
