New-UDDatePicker
Creates a new date picker.
Synopsis
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] [<CommonParameters>]Description
Parameters
-Id
Required? false
Position? 1
Default value [Guid]::NewGuid().ToString()
Accept pipeline input? false
Aliases
Accept wildcard characters? false-Label
-Variant
-OnChange
-Format
-Value
-Locale
-ClassName
-MinimumDate
-MaximumDate
-TimeZone The time zone to use for the date picker. This should be an IANA time zone string.Required? falsePosition? 11Default valueAccept pipeline input? falseAliasesAccept wildcard characters? false -Disabled [<SwitchParameter>] Disables the date picker.Required? falsePosition? namedDefault value FalseAccept pipeline input? falseAliasesAccept wildcard characters? false-Views <String[]>The views to show in the date picker. Valid values are: "day", "year", "month"Required? falsePosition? 12Default value @("day")Accept pipeline input? falseAliasesAccept wildcard characters? false -ShowTime [<SwitchParameter>] Show time in the date picker.Required? falsePosition? namedDefault value FalseAccept pipeline input? falseAliasesAccept wildcard characters? false <CommonParameters> 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-------------------------- EXAMPLE 1 --------------------------PS >New-UDDatePicker -Id 'datepicker1' -Value '1-2-2020'Basic date picker|Creates a new date picker with the default date value.-------------------------- EXAMPLE 2 --------------------------PS >New-UDDatePicker -Id 'datepicker2' -Value '1-2-2020' -OnChange {PS > Show-UDToast -Message "Date selected: $EventData"PS > }Date picker with OnChange|Creates a new date picker with the default date value and an OnChange script block.-------------------------- EXAMPLE 3 --------------------------PS >New-UDDatePicker -Id 'datepicker3' -Value '1-2-2020' -Variant staticStatic date picker|Creates a new date picker with the default date value and the static variant.-------------------------- EXAMPLE 4 --------------------------PS >New-UDDatePicker -Id 'datepicker4' -Value '1-2-2020' -Format 'dd/MM/yyyy'Date picker with custom format|Creates a new date picker with the default date value and a custom format.-------------------------- EXAMPLE 5 --------------------------PS >New-UDDatePicker -Id 'datepicker5' -Value '1-2-2020' -Locale 'de'Date picker with German locale|Creates a new date picker with the default date value and a German locale.-------------------------- EXAMPLE 6 --------------------------PS >New-UDDatePicker -Id 'datepicker6' -Value '1-2-2020' -DisableToolbarDate picker with disabled toolbar|Creates a new date picker with the default date value and a disabled toolbar.-------------------------- EXAMPLE 7 --------------------------PS >New-UDDatePicker -Id 'datepicker7' -Value '1-2-2020' -MinimumDate '1-1-2020'Date picker with minimum date|Creates a new date picker with the default date value and a minimum date.-------------------------- EXAMPLE 8 --------------------------PS >New-UDDatePicker -Id 'datepicker8' -Value '1-2-2020' -MaximumDate '1-1-2021'Date picker with maximum date|Creates a new date picker with the default date value and a maximum date.-------------------------- EXAMPLE 9 --------------------------PS >New-UDDatePicker -Id 'datepicker9' -Value '1-2-2020' -TimeZone 'America/Toronto'Date picker with time zone|Creates a new date picker with the default date value and a time zone.-------------------------- EXAMPLE 10 --------------------------PS >New-UDDatePicker -Id 'datepicker10' -Value '1-2-2020' -DisabledDisabled date picker|Creates a new date picker with the default date value and disabled.-------------------------- EXAMPLE 11 --------------------------PS >New-UDDatePicker -Id 'datepicker11' -Value '1-2-2020' -Views @('day', 'year')Date picker with views|Creates a new date picker with the default date value and only the day and year views.-------------------------- EXAMPLE 12 --------------------------PS >New-UDDatePicker -Id 'datepicker12' -Value '1-2-2020' -ShowTime -Views @('day', 'year', 'hours', 'minutes')Date picker with time|Creates a new date picker with the default date value and time.
Last updated
Was this helpful?