Sha256: 8949100e63dbab9ce69414f69667a25eb286f21c62b662fa468b209cc32d55ef

Contents?: true

Size: 1023 Bytes

Versions: 12

Compression:

Stored size: 1023 Bytes

Contents

/*! Weekday parser - 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 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) {
			if (s) {
				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 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

12 entries across 12 versions & 1 rubygems

Version Path
jquery-tablesorter-1.16.3 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.16.2 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.16.1 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.16.0 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.15.0 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.14.1 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.14.0 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.13.4 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.13.3 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.13.2 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.13.1 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
jquery-tablesorter-1.13.0 vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js