Product: PowerShell Universal
Version: 5.0.14
Hi friends!
We are working with a DataGrid component that is currently reading datetime objects from a database. It is returned from the database as a string, then cast to a PS [datetime]
object before fed into the data grid (where, on render, it is cast back to a [string]
for formatting). I would like to use the -Type
flag on New-UDDataGridColumn
to provide different filtering options than the ones for a string, hopefully ones more fitting for a datetime
object such as prior to and after. When using -Type "dateTime"
however, I’m thrown a JS error that the MUI dateTime
column type only takes Date
objects as values.
So:
- How can I coerce the PS
[datetime]
into a JSDate
object efficiently? Does that simply require invoking JS to create anew Date()
? - Would the column filters update as I expect, providing date filtering?
Tagging @adam as this may be a feature request, or maybe even a bug?