tablesorter/dist/js/parsers/parser-date-weekday.min.js

9 lines
835 B
JavaScript
Raw Normal View History

/*! Parser: weekday - updated 10/26/2014 (v2.18.0) */
2015-10-31 15:08:21 +00:00
/* Demo: http://jsfiddle.net/Mottie/abkNM/4169/ */
/*jshint jquery:true */
!function(a){"use strict";var b=a.tablesorter;b.dates=a.extend({},b.dates,{
// *** modify this array to change match the language ***
weekdayCased:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]}),b.dates.weekdayLower=b.dates.weekdayCased.join(",").toLocaleLowerCase().split(","),b.addParser({id:"weekday",is:function(){return!1},format:function(c,d){if(c){var e=-1,f=d.config;
// return s (original string) if there isn't a match
// (non-weekdays will sort separately and empty cells will sort as expected)
return c=f.ignoreCase?c.toLocaleLowerCase():c,a.each(b.dates["weekday"+(f.ignoreCase?"Lower":"Cased")],function(a,b){return 0>e&&c.match(b)?(e=a,!1):void 0}),0>e?c:e}return c},type:"numeric"})}(jQuery);