Sha256: 7f876f0007fc9813d6d4cfa21cfc01dd5eb1583727dcdc6c181a5ce48f053775

Contents?: true

Size: 930 Bytes

Versions: 20

Compression:

Stored size: 930 Bytes

Contents

/*! Weekday 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 ***
		weekdayCased : [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ]
	});
	ts.dates.weekdayLower = ts.dates.weekdayCased.join(',').toLocaleLowerCase().split(',');

	ts.addParser({
		id: "weekday",
		is: function(){
			return false;
		},
		format: function(s, table) {
			var j = -1, c = table.config;
			s = c.ignoreCase ? s.toLocaleLowerCase() : s;
			$.each(ts.dates[ 'weekday' + (c.ignoreCase ? 'Lower' : 'Cased') ], function(i,v){
				if (j < 0 && s.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

20 entries across 20 versions & 1 rubygems

Version Path
jquery-tablesorter-1.12.8 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.12.7 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.12.6 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.12.5 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.12.4 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.12.3 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.12.2 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.12.1 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.12.0 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.11.2 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.11.1 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.11.0 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.10.10 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.10.9 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.10.8 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.10.7 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.10.6 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.10.5 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.10.4 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.10.3 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js