mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
2 lines
1.0 KiB
JavaScript
2 lines
1.0 KiB
JavaScript
/*! Parser: weekday - updated 11/22/2015 (v2.24.6) */
|
|
!function(e){"use strict";var t=e.tablesorter;t.dates||(t.dates={}),t.dates.weekdays||(t.dates.weekdays={}),t.dates.weekdays.en={sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},t.dates.weekStartList={sun:"1995",mon:"1996",fri:"1999",sat:"2000"},t.dates.weekdaysXref=["sun","mon","tue","wed","thu","fri","sat"],t.addParser({id:"weekday",is:function(){return!1},format:function(a,r,n,s){if(a){var i,d,o,u=r.config,f=u.globalize&&(u.globalize[s]||u.globalize)||{},w=t.dates.weekdays[f.lang||"en"],y=t.dates.weekdaysXref;u.ignoreCase&&(a=a.toLowerCase());for(d in w)if("string"==typeof d&&(i=w[d],u.ignoreCase&&(i=i.toLowerCase()),a.match(i)))return o=e.inArray(d,y),o>-1?o:a}return a},type:"numeric"}),t.addParser({id:"weekday-index",is:function(){return!1},format:function(e,a){if(e){var r=a.config,n=new Date(e);if(n instanceof Date&&isFinite(n))return new Date("1/"+(n.getDay()+1)+"/"+t.dates.weekStartList[r.weekStarts||"sun"])}return e},type:"numeric"})}(jQuery); |