New-UDDatePicker not updated by Set-UDElement

Product: PowerShell Universal
Version: 4.0.2

When calling Set-UDElement to set the value of a New-UDDatePicker, the backing-value is updated, but it does not visually update.

This previously worked (in version 2.12.6)

New-UDDatePicker -Id 'CalendarDatePicker'

New-UDButton -Text 'Change' -OnClick {
    Set-UDElement -Id 'CalendarDatePicker' -Properties @{
        'value' = (Get-Date).AddDays(7)
    $UDElement = Get-UDElement -Id 'CalendarDatePicker'
    Show-UDToast -Persistent -message "$($UDElement)"

Value starts as today’s date. After running the above you get a toast that shows the value is now the 4th of July (7 days from now) - but the date picker has not visually changed.


I’ve also tried calling Sync-UDElement to no avail.

1 Like

same issue…

I current worked around this by putting the datepicker in a div element.
clear that element and set the content with a new datepicker and different value.

its ugly but it seems to do the trick

would be nice to be able to both set and show the value of a datepicker with set-udelement