I am trying to determine the data type (string or date) of the values coming from a loop in a p-table
There is a key called newValue which can have two possible values: newValue: "Percentage"
or
newValue: "2021-03-25T15:55:42.136Z"
If the value is a date, I want to display it as "3/25/21, 9:25 PM"
otherwise just show the string "Percentage"
<td style="width: 10%;">
{{rowData?.histories.newValue ? getDateorStringValue(rowData?.histories.newValue) : 'N/A'}}
</td>
getDateorStringValue(...)
This function is what I'm using, any suggestions on how to achieve this?