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

2 lines
991 B
JavaScript
Raw Normal View History

/*! Parser: weekday - updated 11/2/2015 (v2.24.1) */
!function(a){"use strict";var b=a.tablesorter;b.dates=a.extend(!0,{},{weekdays:{en:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"}},weekStartList:{sun:"1995",mon:"1996",fri:"1999",sat:"2000"},weekdaysXref:["sun","mon","tue","wed","thu","fri","sat"]},b.dates),b.addParser({id:"weekday",is:function(){return!1},format:function(c,d,e,f){if(c){var g,h,i,j=d.config,k=j.globalize&&(j.globalize[f]||j.globalize)||{},l=b.dates.weekdays[k.lang||"en"],m=b.dates.weekdaysXref;j.ignoreCase&&(c=c.toLowerCase());for(h in l)if("string"==typeof h&&(g=l[h],j.ignoreCase&&(g=g.toLowerCase()),c.match(g)))return i=a.inArray(h,m),i>-1?i:c}return c},type:"numeric"}),b.addParser({id:"weekday-index",is:function(){return!1},format:function(a,c){if(a){var d=c.config,e=new Date(a);if(e instanceof Date&&isFinite(e))return new Date("1/"+(e.getDay()+1)+"/"+b.dates.weekStartList[d.weekStarts||"sun"])}return a},type:"numeric"})}(jQuery);