text: !function(t){var e=document,a="createElement",n="getElementsByTagName",i={},r={css:"date_table",id:"date_table",box:"#date_table",toolCss:"date_tool"};r.td={prev:"td_prev",next:"td_next",curr:"td_this"};var c={each:function(t,e){for(var a=0,n=t.length;n>a&&e(a,t[a])!==!1;a++);}},d={format:"YYYY-MM-DD",festival:!0};c.digit=function(t){return 10>t?"0"+(0|t):t},c.isleap=function(t){return t%4===0&&t%100!==0||t%400===0},c.parse=function(t,e,a){return t=t.concat(e),a=a||d.format,a.replace(/YYYY|MM|DD|hh|mm|ss/g,function(){return t.index=0|++t.index,c.digit(t[t.index])})},c.now=function(t,e){var a=new Date(0|t?function(t){return 864e5>t?+new Date+864e5*t:t}(parseInt(t)):+new Date);return c.parse([a.getFullYear(),a.getMonth()+1,a.getDate()],[a.getHours(),a.getMinutes(),a.getSeconds()],e)},c.check=function(t){var e=d.format.replace(/YYYY|MM|DD|hh|mm|ss/g,"\\d+\\").replace(/\\$/g,""),a=new RegExp(e),n=a.test(t)?t.match(/\d+/g):c.now().match(/\d+/g);return c.each(n,function(t){n[t]=parseInt(n[t])}),n},c.festival=function(t,e){var a;switch(t=$(t).find("p"),e){case"1.1":a="元旦";break;case"3.8":a="妇女";break;case"4.5":a="清明";break;case"5.1":a="劳动";break;case"6.1":a="儿童";break;case"9.10":a="教师";break;case"10.1":a="国庆"}a&&t.html(a),a=null},i.table=function(t){var i,d=[],s=["日","一","二","三","四","五","六","星期"],l={},o=e[a]("table"),u=e[a]("thead");return u.appendChild(e[a]("tr")),l.creath=function(i){var r=e[a]("th");r.innerHTML=t?s[7]+s[i]:s[i],u[n]("tr")[0].appendChild(r),r=null},c.each(new Array(6),function(t){d.push([]),i=o.insertRow(0),c.each(new Array(7),function(e){d[t][e]=0,0===t&&l.creath(e),i.insertCell(e)})}),o.insertBefore(u,o.children[0]),o.id=r.id,o.className=r.css,i=d=null,o.outerHTML.toLowerCase()},c.months=[31,null,31,30,31,30,31,31,30,31,30,31],c.viewDate=function(t,e,a){var n={},i=new Date;i.setFullYear(t,e,a),n.ymd=[i.getFullYear(),i.getMonth(),i.getDate()],c.months[1]=c.isleap(n.ymd[0])?29:28,i.setFullYear(n.ymd[0],n.ymd[1],1),n.FDay=i.getDay(),n.PDay=c.months[0===e?11:e-1]-n.FDay+1,n.NDay=1;var s,l=$(r.box);s=function(t,e){this.innerHTML="<p class="+(e||"")+">"+t+"</p>"},l.find("td").each(function(t){var e,i=n.ymd[0],l=n.ymd[1]+1;t<n.FDay?(e=t+n.PDay,s.call(this,e,r.td.prev),1===l&&(i-=1),l=1===l?12:l-1):t>=n.FDay&&t<n.FDay+c.months[n.ymd[1]]?(e=t-n.FDay+1,s.call(this,e,e==a?r.td.curr:!1),c.click&&$(this).on("click",function(){c.click([i,l,e])}),t-n.FDay+1===n.ymd[2]&&(n.thisDay=this)):(e=n.NDay++,s.call(this,e,r.td.next),12===l&&(i+=1),l=12===l?1:l+1),d.festival&&c.festival(this,l+"."+e),c.data&&c.data.call(this,[i,c.digit(l),c.digit(e)],c.ajax?c.ajax.data:!1),this.setAttribute("y",i),this.setAttribute("m",l),this.setAttribute("d",e)})},c.init=function(t){c.table=i.table(t.week||!1),this.innerHTML=c.table,c.ymd=c.check(t.date||!1),t.url&&(c.url=t.url),t.header&&s.header(t.header),t.click&&"function"==typeof t.click&&(c.click=t.click),t.data&&"function"==typeof t.data&&(c.data=t.data),c.start()},c.start=function(){var t=function(){var t=parseInt(c.ymd[1])-1;c.viewDate(c.ymd[0],t,c.ymd[2])};if(c.url){var e=c.ymd[0],a=c.ymd[1],n=c.months[parseInt(a)-1]||(c.isleap(e)?29:28);a=c.digit(a),n=c.digit(n);var i=[e,a,"01"].join("-"),r=[e,a,n].join("-");$.ajax({url:c.url,data:{stat:i,end:r},success:function(e){e&&0===e.status&&(c.ajax=e),t()},timeout:1e4,error:function(){t()},dataType:"json",type:"get",cache:!1})}else t()};var s={header:function(t){var e,a={left:t.left,right:t.right},n=$(r.box);e=$("<div><span>"+c.ymd[0]+"年"+c.ymd[1]+"月</span></div>").addClass(r.toolCss),a.left&&e.prepend($("<cite>"+a.left+"</cite>")),a.right&&e.append($("<em>"+a.right+"</em>")),n.before(e);var i=$("."+r.toolCss),d=i.find("span");i.find("cite").on("click",function(){1===c.ymd[1]&&(c.ymd[0]-=1),c.ymd[1]=1===c.ymd[1]?12:c.ymd[1]-1,c.start(),d.html(c.ymd[0]+"年"+c.ymd[1]+"月")}),i.find("em").on("click",function(){12===c.ymd[1]&&(c.ymd[0]+=1),c.ymd[1]=12===c.ymd[1]?1:c.ymd[1]+1,c.start(),d.html(c.ymd[0]+"年"+c.ymd[1]+"月")})}},l=function(t,e){e=e||{},c.init.call(t,e)};l.now=c.now,"function"==typeof define?define(function(t,e,a){return a.exports=l,l}):t.date=l}(window);