Open ekarudianto opened 8 years ago
Good point, thanks. The sorting now always orders by string value. I think your solution is nice but we can implement a more generic solution by allowing people to provide their own comparator. This allows you to create a custom compare function for every sort of data, not just number, string, and Date. It should be possible to configure a comparator for each individual column.
As for your specific use case: it may be better to provide the date dateEnter
as a timestamp or ISOString, and use a format function to display it in a form like "30 Nov, 2015"
.
I found a bug when I do a sorting based on date, it doesn't sorted out right because it's sorted based on string.. I manage to made a workaround by adding new option which is
sortableType
the default value would be "string" but it could be a date as well.. and also I remove the sorting case sensitive by converting all the strings into lower case
I reallly hope this helps you Jos ! and please review my code if you have time and see if I missed something :)