New-UDDatePicker Range

Is there any best practice for setting upper and lower boundaries for a Date Picker input? So far I’ve been using OnChange to parse the input and show a toast or modal, but I’m curious how other folks have handled. Using OnChange is a bit hairy because then it reacts every time someone begins typing in the input as opposed to using the DatePicker itself.

It would be ideal if you could specify a valid range of inputs in the New-UDDatePicker cmdlet, but I understand that could be a whole can of worms in its own right. Something like

$today = Get-Date
New-UDDatePicker -Value $today -UpperLimit $($today.addDays(365)) -LowerLimit $($today.addDays(-7))
Product: PowerShell Universal
Version: 2.12.2
1 Like

The date picker component we are using has max\min date properties we can set so we should be able to implement this pretty easily. I’ll open an issue for it.

2 Likes