Fix: Description text for natural sorting and monthYear sorting was incorrect - 10934

pull/2/merge
Allan Jardine 13 years ago
parent 3af3ee2c1d
commit fb0586c25e

@ -1,16 +1,16 @@
/**
* Often a list of data which has titles in it (books, albums etc) will have
* the word "the" at the start of some individual titles, which you don't want
* to include in your sorting order. This plug-in will strip the word "the"
* from the start of a string and sort on what is left.
* This sorting plug-in will sort, in calendar order, data which
* is in the format "MM YY".
* @name Month / year sorting
* @anchor monthYear
* @author Michael Motek
*/
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
"monthYear-pre": function ( a ) {
return new Date('01 '+a);
"monthYear-pre": function ( s ) {
var a = s.split(' ');
// Date uses the American "MM DD YY" format
return new Date(a[0]+' 01 '+a[1]);
},
"monthYear-asc": function ( a, b ) {

@ -1,8 +1,10 @@
/**
* Often a list of data which has titles in it (books, albums etc) will have
* the word "the" at the start of some individual titles, which you don't want
* to include in your sorting order. This plug-in will strip the word "the"
* from the start of a string and sort on what is left.
* Data can often be a complicated mix of numbers and letters (file names
* are a common example) and sorting them in a natural manner is quite a
* difficult problem. Fortunately a deal of work has already been done in
* this area by other authors - the following plug-in uses the naturalSort()
* function by Jim Palmer (<a href="http://www.overset.com/2008/09/01/javascript-natural-sort-algorithm-with-unicode-support/">download it here</a>)
* to provide natural sorting in DataTables.
* @name Natural sorting
* @anchor natrual
* @author <a href="http://www.overset.com/2008/09/01/javascript-natural-sort-algorithm/">Jim Palmer</a>

Loading…
Cancel
Save