Data table sorting issue in Firefox with the date format M-d-yyyy

Data table sorting issue in Firefox with the date format M-d-yyyy

spothugantispothuganti Posts: 2Questions: 2Answers: 0

Hi,
I am using the plugin code at https://datatables.net/plug-ins/sorting/date-de
In our application we support all different date formats.
I have modified the date-de.js to meet our requirements.
But For the date format "M-d-yyyy", the data is not getting sorted correctly in firefox.
But it is sorting correctly in internet Explorer and chrome.
Can you please look into this and let me know if you need more information.
Sample test data:
Below is the order of the dates which I am getting in firefox.
9-29-2014
11-7-2014
10-30-2014
Where as in Internet Explorer and Chrome the correct order is getting displayed:
11-7-2014
10-30-2014
9-29-2014
I am testing in
1)InternetExplorer Version 8.0.7601.17514
2)Chrome 10-30-2014 Version 38.0.2125.111 m
3)And Firefox 24.8.1 ESR and FireFox 30.0--->In both these versions the sorting is not working fine,

More information:

I have changed the above "date-de.js" to handle the "-" in the date as follows:

else if (a.indexOf('-') > 0) {
var deDatea = $.trim(a).split('-');
if (deDatea[1].length == 1) {
deDatea[1] = 0 + deDatea[1];
}
if (deDatea[2].length == 1) {
deDatea[2] = 0 + deDatea[2];
}
x = (deDatea[2] + deDatea[1] + deDatea[0]) * 1;
}

The problem is I am getting the dates getting compared and sorted correctly within the modified version of the https://datatables.net/plug-ins/sorting/date-de,

seems the firefox is overriding the final result.

Can you please look into this issue with FireFox?

Please let me know if you need more information.

Thanks,
Siddi Khadar.

This discussion has been closed.