Right now I am using primeng's p-table and one of the columns have this list of datestrings in the mentioned format and the column sorting is not right as it is sorts the string as it is and not by date value. I want this "26/12/2019 06:55:21 AM" string value to be a date and would want to check if the primeng sorting works accordingly after conversion atleast.
Asked
Active
Viewed 64 times
0
-
1Date pipe? https://angular.io/api/common/DatePipe – maxime1992 Feb 10 '20 at 12:37
-
you can try like this new Date("26/12/2019 06:55:21 AM" ) it will convert your string date to a date time object. – Yash Rami Feb 10 '20 at 12:41
-
checkout this [answer](https://stackoverflow.com/a/41452271/7541317). this is related to your current issue. hope it will be helpfull for you. – Farhat Zaman Feb 10 '20 at 12:45