Problem with sorting date. Sorting works by hours not by all date: console.log
-
- apr. 2022 16.54.32
-
- jan. 2022 12.57.16
-
- aug. 2022 10.52.22
-
- apr. 2022 16.54.32
announceSortChange(sortState: Sort) {
this.dataSource.sortingDataAccessor = (item, property) => {
console.log(item.timeStamp)
switch (property) {
case 'time':
return item.time;
break;
default:
return item[property];
}
};
///this code from table whre table is:
getColumns() {
return [
{
key: 'time',
getValue: element => element.time,
title: $localize`:|Column:Date`,
}}
export interface Task { id: number; time: string; }
table is reusable and self-adjusts to the data
I put something like that:
return item.time = new Date(item[property]).getTime();
and when I press sort In table I have: NaN