All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.datatables.sorting.natural.min.js Maven / Gradle / Ivy

There is a newer version: 0.66.0.1
Show newest version
(function(){function naturalSort(a,b){var re=/(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,sre=/(^[ ]*|[ ]*$)/g,dre=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,hre=/^0x[0-9a-f]+$/i,ore=/^0/,x=a.toString().replace(sre,"")||"",y=b.toString().replace(sre,"")||"",xN=x.replace(re,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),yN=y.replace(re,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),xD=parseInt(x.match(hre),10)||xN.length!==1&&x.match(dre)&&Date.parse(x),yD=parseInt(y.match(hre),10)||xD&&y.match(dre)&&Date.parse(y)||null;if(yD){if(xDyD){return 1}}for(var cLoc=0,numS=Math.max(xN.length,yN.length);cLocoFyNcL){return 1}}return 0}jQuery.extend(jQuery.fn.dataTableExt.oSort,{"natural-asc":function(a,b){return naturalSort(a,b)},"natural-desc":function(a,b){return naturalSort(a,b)*-1}})})();




© 2015 - 2025 Weber Informatics LLC | Privacy Policy