Skip to content
Advertisement

Sorting the Date of Format DD.MM.YYYY in javascript

I have set of Data having date along with the list. I need to sort the fields. I am able to sort all other fields except Date. Find below the code. And also if I sort the column “Name”, the other two column’s icon also changing. I want the solution like if i sort the particular column, that particular column arrow icon should change not other two columns icon.

So My Question is how to sort the date Column and and the icon of that particular column should only change when i tap on that particular column.

HTML

JavaScript

TYPESCRIPT

JavaScript

Advertisement

Answer

  1. Create Date objects from date strings
  2. Sort ascending based on valueOf

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement