Sha256: 22c4b5c537fa704b1cb3149fa5b2528d00b296af059649f80d3f0bbb87361503
Contents?: true
Size: 953 Bytes
Versions: 19
Compression:
Stored size: 953 Bytes
Contents
/*! Month parser * Demo: http://jsfiddle.net/Mottie/abkNM/477/ */ /*jshint jquery:true */ ;(function($){ "use strict"; var ts = $.tablesorter; ts.dates = $.extend({}, ts.dates, { // *** modify this array to change match the language *** monthCased : [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ] }); ts.dates.monthLower = ts.dates.monthCased.join(',').toLocaleLowerCase().split(','); ts.addParser({ id: "month", is: function(){ return false; }, format: function(s, table) { var j = -1, c = table.config, n = c.ignoreCase ? s.toLocaleLowerCase() : s; $.each(ts.dates[ 'month' + (c.ignoreCase ? 'Lower' : 'Cased') ], function(i,v){ if (j < 0 && n.match(v)) { j = i; } }); // return s (original string) if there isn't a match // (non-weekdays will sort separately and empty cells will sort as expected) return j < 0 ? s : j; }, type: "numeric" }); })(jQuery);
Version data entries
19 entries across 19 versions & 1 rubygems