For the complete documentation index, see llms.txt. This page is also available as Markdown.

New-UDDatePicker

Synopsis

Creates a new date picker.

Syntax

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] [[-Aria] <ScriptBlock>] [<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.

-Variant

The theme variant to apply to the date picker.

-DisableToolbar

Disables the date picker toolbar.

-OnChange

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

-Format

The format of the date when it is selected.

-Value

The current value of the date picker.

-Locale

Change the language of the date picker.

-ClassName

A CSS class to apply to the date picker.

-MinimumDate

The minimum date that can be selected.

-MaximumDate

The maximum date that can be selected.

-TimeZone

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

-Disabled

Disables the date picker.

-Views <String[]>

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

-ShowTime

Show time in the date picker.

-Aria

A script block of New-UDAriaAttribute calls that supplies ARIA or role attributes for the date picker.

Common parameters

This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters.

Outputs

Examples

Example 1: Basic date picker

Creates a new date picker with the default date value.

Example 2: Date picker with OnChange

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

Example 3: Static date picker

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

Example 4: Date picker with custom format

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

Example 5: Date picker with German locale

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

Example 6: Date picker with disabled toolbar

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

Example 7: Date picker with minimum date

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

Example 8: Date picker with maximum date

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

Example 9: Date picker with time zone

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

Example 10: Disabled date picker

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

Example 11: Date picker with views

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

Example 12: Date picker with time

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

Last updated

Was this helpful?