I have a table component in a perspective view that pulls data from a db table and displays it. When the data is pulled, the date values are formatted correctly in the property table.data :
However, in the table.selection.data property, these same dates are formatted in a long string format:
Is there a way to convert these string versions of the data back to date format? Or even better, can I have the table.selection.data property have the same format as the table.data property for its values?
I tried system.date.parse()to convert the strings, but it does not take the long string as input.
This is an unfortunate side effect of browsers not actually supporting date/time objects.
The stringified date is also localized to a time zone, complicating parsing.
The robust solution is to include an extra key in the table's props.data that is the row index. Then the consumer of the selection data can look up the original row data in the source.
This is also necessary for any row data that has nested objects--those are collapsed and lost in selection data.