From 2ba2b09b5216563492d506a0d59998634fdc6f51 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Fri, 16 May 2014 10:24:24 +0100 Subject: [PATCH] Fix: #54 - Use year as an integer --- sorting/date-dd-MMM-yyyy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sorting/date-dd-MMM-yyyy.js b/sorting/date-dd-MMM-yyyy.js index 7d6758f..c11e02f 100644 --- a/sorting/date-dd-MMM-yyyy.js +++ b/sorting/date-dd-MMM-yyyy.js @@ -25,7 +25,7 @@ var customDateDDMMMYYYYToOrd = function (date) { "use strict"; //let's avoid tom-foolery in this function // Convert to a number YYYYMMDD which we can use to order var dateParts = date.split(/-/); - return (dateParts[2] * 10000) + ($.inArray(dateParts[1].toUpperCase(), ["JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"]) * 100) + dateParts[0]; + return (dateParts[2] * 10000) + ($.inArray(dateParts[1].toUpperCase(), ["JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"]) * 100) + (dateParts[0]*1); }; // This will help DataTables magic detect the "dd-MMM-yyyy" format; Unshift