I am working with NGX Datatables, and I have all my data sorting correctly, besides the dates. It seems that NGX's inbuilt sort is sorting from left to right, so it sorts the month/day but not by year. I am trying to sort with this format ('MM-DD-YYYY h:mm A'). If I change to this format ('YYYY-MM-DDh:mm A') it works just fine. I saw someone else said to use the pipe date in angular for dates, so I tried
{{value | date:'MM-DD-YYYY h:mm A'}}
but that also didn't work. It still doesn't sort the years. So it will sort the month and day, but the year will be mixed. Does anyone know a fix for this? And if not, is there way I can add a custom sort to just one column?
I am currently using this configuration to allow the built in sort to sort all of my data.
[sorts]="[{prop: 'status', dir: 'desc'}]">
I think I need to create my own sort for the date column though, if I can't get it to sort the year. Is there a way to keep the custom sort for all columns but one, and add my own sort to that column? Any help would be appreciated! Thank you!