mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-12-05 05:04:20 +00:00
2 lines
1.0 KiB
JavaScript
2 lines
1.0 KiB
JavaScript
/*! Parser: weekday - updated 11/22/2015 (v2.24.6) */
|
|
!function(a){"use strict";var b=a.tablesorter;b.dates||(b.dates={}),b.dates.weekdays||(b.dates.weekdays={}),b.dates.weekdays.en={sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},b.dates.weekStartList={sun:"1995",mon:"1996",fri:"1999",sat:"2000"},b.dates.weekdaysXref=["sun","mon","tue","wed","thu","fri","sat"],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); |