> 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/powershell-commands/new-uddatepicker.md).

# New-UDDatePicker

New-UDDatePicker creates a date selection control in PowerShell Universal, usable standalone or as an input field inside New-UDForm.

### Synopsis

Creates a new date picker.

### Syntax

```powershell
New-UDDatePicker [[-Id] <String>] [[-Label] <String>] [[-Variant] <String>] [-DisableToolbar] [[-OnChange] <Endpoint>] [[-Format] <String>] [[-Value] <DateTime>] [[-Locale] <String>] [[-ClassName] <String>] [[-MinimumDate] <DateTime>] [[-MaximumDate] <DateTime>] [[-TimeZone] <Object>] [-Disabled] [[-Views] <String[]>] [-ShowTime] [<CommonParameters>]
```

### Description

Creates a new date picker. Date pickers can be used stand alone or within New-UDForm.

### Parameters

#### -Id

The ID of the component. It defaults to a random GUID.

```
Required?                    false
Position?                    1
Default value                [Guid]::NewGuid().ToString()
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Label

The label to show next to the date picker.

```
Required?                    false
Position?                    2
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Variant

The theme variant to apply to the date picker.

```
Required?                    false
Position?                    3
Default value                inline
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -DisableToolbar

Disables the date picker toolbar.

```
Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -OnChange

A script block to call with the selected date. The $EventData variable will be the date selected.

```
Required?                    false
Position?                    4
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Format

The format of the date when it is selected.

```
Required?                    false
Position?                    5
Default value                MM/DD/YYYY
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Value

The current value of the date picker.

```
Required?                    false
Position?                    6
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Locale

Change the language of the date picker.

```
Required?                    false
Position?                    7
Default value                en
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -ClassName

A CSS class to apply to the date picker.

```
Required?                    false
Position?                    8
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -MinimumDate

The minimum date that can be selected.

```
Required?                    false
Position?                    9
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -MaximumDate

The maximum date that can be selected.

```
Required?                    false
Position?                    10
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -TimeZone

The time zone to use for the date picker. This should be an IANA time zone string.

```
Required?                    false
Position?                    11
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Disabled

Disables the date picker.

```
Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Views \<String\[]>

The views to show in the date picker. Valid values are: "day", "year", "month"

```
Required?                    false
Position?                    12
Default value                @("day")
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -ShowTime

Show time in the date picker.

```
Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### Common parameters

This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see [about\_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

### Outputs

### Examples

#### Example 1: Basic date picker

```powershell
New-UDDatePicker -Id 'datepicker1' -Value '1-2-2020'
```

Creates a new date picker with the default date value.

#### Example 2: Date picker with OnChange

```powershell
New-UDDatePicker -Id 'datepicker2' -Value '1-2-2020' -OnChange {
   Show-UDToast -Message "Date selected: $EventData"
}
```

Creates a new date picker with the default date value and an OnChange script block.

#### Example 3: Static date picker

```powershell
New-UDDatePicker -Id 'datepicker3' -Value '1-2-2020' -Variant static
```

Creates a new date picker with the default date value and the static variant.

#### Example 4: Date picker with custom format

```powershell
New-UDDatePicker -Id 'datepicker4' -Value '1-2-2020' -Format 'dd/MM/yyyy'
```

Creates a new date picker with the default date value and a custom format.

#### Example 5: Date picker with German locale

```powershell
New-UDDatePicker -Id 'datepicker5' -Value '1-2-2020' -Locale 'de'
```

Creates a new date picker with the default date value and a German locale.

#### Example 6: Date picker with disabled toolbar

```powershell
New-UDDatePicker -Id 'datepicker6' -Value '1-2-2020' -DisableToolbar
```

Creates a new date picker with the default date value and a disabled toolbar.

#### Example 7: Date picker with minimum date

```powershell
New-UDDatePicker -Id 'datepicker7' -Value '1-2-2020' -MinimumDate '1-1-2020'
```

Creates a new date picker with the default date value and a minimum date.

#### Example 8: Date picker with maximum date

```powershell
New-UDDatePicker -Id 'datepicker8' -Value '1-2-2020' -MaximumDate '1-1-2021'
```

Creates a new date picker with the default date value and a maximum date.

#### Example 9: Date picker with time zone

```powershell
New-UDDatePicker -Id 'datepicker9' -Value '1-2-2020' -TimeZone 'America/Toronto'
```

Creates a new date picker with the default date value and a time zone.

#### Example 10: Disabled date picker

```powershell
New-UDDatePicker -Id 'datepicker10' -Value '1-2-2020' -Disabled
```

Creates a new date picker with the default date value and disabled.

#### Example 11: Date picker with views

```powershell
New-UDDatePicker -Id 'datepicker11' -Value '1-2-2020' -Views @('day', 'year')
```

Creates a new date picker with the default date value and only the day and year views.

#### Example 12: Date picker with time

```powershell
New-UDDatePicker -Id 'datepicker12' -Value '1-2-2020' -ShowTime -Views @('day', 'year', 'hours', 'minutes')
```

Creates a new date picker with the default date value and time.


---

# 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/powershell-commands/new-uddatepicker.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.
