Does anyone know how to properly format a DateTime in the grid? (Is this datatype even supported?).
No matter what I put in the \"filter\" property of the column, my
I solved the same issue using a date pipe in a template column. Make sure you check for null values.
{{ formatDate(dataItem.lastLoginDate) | date:"shortDate" }}
function in component.ts pulls out the usable part of the date string and converts it to a JS date so the Date Pipe can use it.
formatDate(myStringDate) {
return new Date(parseInt(myStringDate.substr(6)));
}
I used the shortDate format, but you can find more format options here including time formats: Angular 2 Date Pipe Formatters