Has anyone implemented a Date Picker Input field?
New-UDElement -Id ‘date’ -Tag ‘input’ -Attributes @{
type = “date”
id = “date”
value = “”
}
So I got this showing but how can I set the Value attribute to grab the value of the date picker?? or this not possible?
You can use New-UDInput to create a datepicker but I don’t think you’ll be able to do it with New-UDElement.
Here’s an example of how we use it in the integration tests:https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard.UITest/Integration/Input.Tests.ps1#L151
@adam, question, is there any way to change this behavior? after a date is selected, and you call the date picker again, a date of 1918 is shown
Unfortunately, there is a bug in the JavaScript library we are using for this. I have this slated for 3.0 at the moment but if I can fix it earlier, I will.
AWESOMENESS! thanks @adam !
Hey @adam, noticed this since upgrading to UD 2.3.2 ENT, the date picker now flashes and doesn’t allow users to select a data.
Sample code:
$Dash = New-UDDashboard -Title "Test Dash..." -Content {
New-UDInput -Title "Select Range (DAY/MONTH/YEAR)" -Id "DateForm" -Content {
New-UDInputField -Type 'date' -Name 'DateFrom' -Placeholder 'FROM:' -DefaultValue "01-01-2019"
New-UDInputField -Type 'date' -Name 'DateTo' -Placeholder 'TO:'-DefaultValue "01-02-2019"
} -Endpoint {
param(
$DateFrom,
$DateTo
)
}
}
Start-UDDashboard -Port 8091 -Dashboard $Dash
I had a report of this happening from one of my users. If they try to click into the field, it flashes and doesn’t allow them to pick a date.
If you tab into it, it works normally.
However, i am unable to reproduce this issue on my computer.
I’m seeing this on my machine with 2.4 installed. It’s strange because it’s not failing that particular integration test on the builder. I noticed that if I right click rather than left click it stays open. Very weird.
I had similar issues running 2.3.2. Seems to only be a problem in Chrome for me. Internet Explorer and Firefox seems fine.
yup weird stuff experiencing this in chrome, and ie, the right click opens the picker but hides the controls in the bottom left… strange