Sha256: 4623cebf7f5efd2dea14a74028d4acfc7d945bf28871d22a7f8846bf5bbc3e55

Contents?: true

Size: 1.04 KB

Versions: 8

Compression:

Stored size: 1.04 KB

Contents

/*! Parser: Month - updated 10/26/2014 (v2.18.0) */
/* Demo: http://jsfiddle.net/Mottie/abkNM/4169/ */
/*jshint jquery:true */
;(function($){
	'use strict';

	var ts = $.tablesorter;
	ts.dates = $.extend({}, ts.dates, {
		// *** modify this array to match the desired 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) {
			if (s) {
				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 false;
					}
				});
				// 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;
			}
			return s;
		},
		type: 'numeric'
	});

})(jQuery);

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
jquery-tablesorter-1.18.5 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-month.js
jquery-tablesorter-1.18.4 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-month.js
jquery-tablesorter-1.18.3 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-month.js
jquery-tablesorter-1.18.2 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-month.js
jquery-tablesorter-1.18.1 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-month.js
jquery-tablesorter-1.18.0 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-month.js
jquery-tablesorter-1.17.4 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-month.js
jquery-tablesorter-1.17.3 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-month.js