I\'m using angular material table and using matSort for sorting. But it\'s not sorting the dates/time column. It takes the datetime column values as strings.
How to sor
In addition to the Sagar Kharche's post, if your date is from firebase, I recommended you to do this:
this.dataSource.sortingDataAccessor = (item, property) => {
console.log(item)
switch (property) {
case 'fromDate': {
return new Date(item.fromDate.seconds * 1000);
}
default: return item[property];
}
};