text: /**
   @Name : jeDate v3.4 日期控件
   @Author: chen guojun
   @Date: 2016-9-6
   @QQ群：516754269
   @官网：http://www.jayui.com/jedate/ 或 https://github.com/singod/jeDate
   */
  window.console&&(console=console||{log:function(){}}),function(a,b){"function"==typeof define&&define.amd?define(["jeDate"],b):"object"==typeof exports?module.exports=b(require("jeDate")):a.jeDate=b(a.jeDate)}(this,function(a){var g,b={},c=document,d=/\w+|d+/g,e=function(a){return window.parseInt(a,10)},f=function(){function a(l,m){var n,o,p,q,r,s;if(m=m||document,!/^[\w\-_#]+$/.test(l)&&m.querySelectorAll)return b(m.querySelectorAll(l));if(-1<l.indexOf(",")){for(n=l.split(/,/g),o=[],p=0,q=n.length;q>p;++p)o=o.concat(a(n[p],m));return k(o)}if(n=l.match(e),o=n.pop(),q=(o.match(g)||i)[1],r=!q&&(o.match(f)||i)[1],p=!q&&(o.match(h)||i)[1],o=l.match(/\[(?:[\w\-_][^=]+)=(?:[\'\[\]\w\-_]+)\]/g),r&&!o&&!p&&m.getElementsByClassName)p=b(m.getElementsByClassName(r));else{if(p=!q&&b(m.getElementsByTagName(p||"*")),r&&(p=d(p,"className",RegExp("(^|\\s)"+r+"(\\s|$)"))),q)return(n=m.getElementById(q))?[n]:[];if(o)for(q=0;q<o.length;q++)r=(o[q].match(j)||i)[1],s=(o[q].match(j)||i)[2],s=s.replace(/\'/g,"").replace(/\-/g,"\\-").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),p=d(p,r,RegExp("(^"+s+"$)"))}return n[0]&&p[0]?c(n,p):p}function b(a){try{return Array.prototype.slice.call(a)}catch(b){for(var c=[],d=0,e=a.length;e>d;++d)c[d]=a[d];return c}}function c(a,b,d){var o,p,q,j,k,l,m,n,e=a.pop();if(">"===e)return c(a,b,!0);for(j=[],k=-1,l=(e.match(g)||i)[1],m=!l&&(e.match(f)||i)[1],e=!l&&(e.match(h)||i)[1],n=-1,e=e&&e.toLowerCase();o=b[++n];){p=o.parentNode;do if(q=(q=(q=!e||"*"===e||e===p.nodeName.toLowerCase())&&(!l||p.id===l))&&(!m||RegExp("(^|\\s)"+m+"(\\s|$)").test(p.className)),d||q)break;while(p=p.parentNode);q&&(j[++k]=o)}return a[0]&&j[0]?c(a,j):j}function d(a,b,c){for(var e,d=-1,f=-1,g=[];e=a[++d];)c.test(e.getAttribute(b))&&(g[++f]=e);return g}var e=/(?:[\*\w\-\\.#]+)+(?:\[(?:[\w\-_][^=]+)=(?:[\'\[\]\w\-_]+)\])*|\*|>/gi,f=/^(?:[\w\-_]+)?\.([\w\-_]+)/,g=/^(?:[\w\-_]+)?#([\w\-_]+)/,h=/^([\w\*\-_]+)/,i=[null,null,null],j=/\[([\w\-_][^=]+)=([\'\[\]\w\-_]+)\]/,k=function(){var a=+new Date,b=function(){var b=1;return function(c){var d=c[a],e=b++;return d?!1:(c[a]=e,!0)}}();return function(c){for(var h,d=c.length,e=[],f=-1,g=0;d>g;++g)h=c[g],b(h)&&(e[++f]=h);return a+=1,e}}();return a}();return b.isType=function(a,b){return b=b.replace(/\b(\w)|\s(\w)/g,function(a){return a.toUpperCase()}),Object.prototype.toString.call(a)==="[object "+b+"]"},b.each=function(a,c){var d,e,f;if(b.isType(a,"array"))for(d=0,e=a.length;e>d&&c.call(a[d],d,a[d])!==!1;d++);else for(f in a)if(a.hasOwnProperty(f)&&c.call(a[f],f,a[f])===!1)break},b.attr=function(a,b,c){return"string"==typeof b&&"undefined"==typeof c?a.getAttribute(b):(a.setAttribute(b,c),this)},b.stopmp=function(a){return a=a||window.event,a.stopPropagation?a.stopPropagation():a.cancelBubble=!0,this},b.hasClass=function(a,b){return a=a||{},new RegExp("\\b"+b+"\\b").test(a.className)},b.addClass=function(a,c){return a=a||{},b.hasClass(a,c)||(a.className+=" "+c),a.className=a.className.replace(/^\s|\s$/g,"").replace(/\s+/g," "),this},b.removeClass=function(a,c){return a=a||{},b.hasClass(a,c)&&(a.className=a.className.replace(new RegExp("(\\s|^)"+c+"(\\s|$)"),"")),this},b.getStyle=function(a,b){var c=document.defaultView?window.getComputedStyle(a,null)[b]:a.currentStyle[b];return c},b.isShow=function(a,b){a.style.display=1!=b?"none":"block"},b.html=function(a,b){return"undefined"!=typeof b||void 0!==b&&1===a.nodeType?(a.innerHTML=b,this):a.innerHTML},b.text=function(a,c){if(void 0===c||1!==a.nodeType){var d=document.all?a.innerText:a.textContent;return b.trim(d)}return document.all?a.innerText=c:a.textContent=c,this},b.val=function(a,c){return void 0===c||1!==a.nodeType?b.trim(a.value):(a.value=c,this)},b.bind=function(a,c,d){c=c.toLowerCase();var e=function(a){a.attachEvent?a.attachEvent("on"+c,function(){d.call(a,window.type)}):a.addEventListener(c,d,!1)};return a==document?e(document):b.each(a,function(a,b){e(b)})},b.docScroll=function(a){return a=a?"scrollLeft":"scrollTop",c.body[a]|c.documentElement[a]},b.winarea=function(a){return c.documentElement[a?"clientWidth":"clientHeight"]},b.isLeap=function(a){return 0!==a%100&&0===a%4||0===a%400},b.getDaysNum=function(a,c){var d=31;switch(e(c)){case 2:d=b.isLeap(a)?29:28;break;case 4:case 6:case 9:case 11:d=30}return d},b.getYM=function(a,b,c){var d=new Date(a,b-1);return d.setMonth(b-1+c),{y:d.getFullYear(),m:d.getMonth()+1}},b.getPrevMonth=function(a,c,d){return b.getYM(a,c,0-(d||1))},b.getNextMonth=function(a,c,d){return b.getYM(a,c,d||1)},b.digit=function(a){return 10>a?"0"+(0|a):a},b.IsNum=function(a){return null!=a&&""!=a?!isNaN(a):!1},b.parse=function(a,c,d){a=a.concat(c);var e="hh:mm"==b.parseCheck(d,!1).substring(0,5),f=2;return d.replace(/YYYY|MM|DD|hh|mm|ss/g,function(){var g=e?++f:a.index=0|++a.index;return b.digit(a[g])})},b.parseCheck=function(a,b){var c=[];return a.replace(/YYYY|MM|DD|hh|mm|ss/g,function(a){c.push(a)}),c.join(1==b?"-":":")},b.checkFormat=function(a){var b=[];return a.replace(/YYYY|MM|DD|hh|mm|ss/g,function(a){b.push(a)}),b.join("-")},b.parseMatch=function(a){var b=a.split(" ");return b[0].match(d)},b.checkDate=function(a){var b=a.match(d);if(isNaN(b[0])||isNaN(b[1])||isNaN(b[2]))return!1;if(b[1]>12||b[1]<1)return!1;if(b[2]<1||b[2]>31)return!1;if((4==b[1]||6==b[1]||9==b[1]||11==b[1])&&b[2]>30)return!1;if(2==b[1]){if(b[2]>29)return!1;if((0==b[0]%100&&0!=b[0]%400||0!=b[0]%4)&&b[2]>28)return!1}return!0},b.trim=function(a){return a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},b.nowDate=function(a,c){var d,f,g,h,i,j,k,l;return c=c||"YYYY-MM-DD hh:mm:ss","string"==typeof a?d=new Date(1e3*e(a)):(a=0|a,d=new Date,f=d.getTime()+864e5*a,d.setTime(f)),g=d.getFullYear(),h=d.getMonth()+1,i=d.getDate(),j=d.getHours(),k=d.getMinutes(),l=d.getSeconds(),b.parse([g,b.digit(h),b.digit(i)],[b.digit(j),b.digit(k),b.digit(l)],c)},b.montharr=[1,2,3,4,5,6,7,8,9,10,11,12],b.weeks=["日","一","二","三","四","五","六"],b.isValHtml=function(a){return/textarea|input/.test(a.tagName.toLocaleLowerCase())},b.festival=function(a,b){var c="";switch(a){case"1.1":c="元旦";break;case"2.14":c="情人";break;case"3.8":c="妇女";break;case"5.1":c="劳动";break;case"6.1":c="儿童";break;case"8.1":c="建军";break;case"9.10":c="教师";break;case"10.1":c="国庆";break;case"12.24":c="平安";break;case"12.25":c="圣诞";break;default:c=b}return c},g={skinCell:"jedateblue",initAddVal:[0],format:"YYYY-MM-DD hh:mm:ss",minDate:"1900-01-01 00:00:00",maxDate:"2099-12-31 23:59:59",startMin:"",startMax:""},b.index=Math.floor(9e3*Math.random()),b.boxCell="#jedatebox",b.find=function(a){return f(b.boxCell+" "+a)},b.isBool=function(a){return void 0==a||1==a?!0:!1},b.addDateTime=function(a,c,f,g){var h="hh-mm"==b.checkFormat(g).substring(0,5)?!0:!1,i=h?a.replace(/^(\d{2})(?=\d)/g,"$1,"):a.substr(0,4).replace(/^(\d{4})/g,"$1,")+a.substr(4).replace(/^(\d{2})(?=\d)/g,"$1,"),j=b.IsNum(a)?i.match(d):a.match(d),k=new Date,l=e(j[0]),m=void 0==j[1]?k.getMonth()+1:e(j[1]),n=void 0==j[2]?k.getDate():e(j[2]),o=void 0==j[3]?k.getHours():e(j[3]),p=void 0==j[4]?k.getMinutes():e(j[4]),q=void 0==j[5]?k.getMinutes():e(j[5]),r=new Date(l,b.digit(m)-1,"DD"==f?n+c:n,"hh"==f?o+c:o,"mm"==f?p+c:p,b.digit(q));return b.parse([r.getFullYear(),r.getMonth()+1,r.getDate()],[r.getHours(),r.getMinutes(),r.getSeconds()],g)},b.initDate=function(d){var e=b.event?b.event:window.event,i=void 0==d.isinitVal||0==d.isinitVal?!1:!0,j=function(e,h){if(!f(h)[0]){b.opts=d,b.format=d.format||g.format,minTime=b.opts.minDate||g.minDate,maxTime=b.opts.maxDate||g.maxDate,b.fixed=b.isBool(d.fixed),/\YYYY-MM-DD/.test(b.checkFormat(b.format))?(b.checkDate(minTime)?b.minDate=minTime:alert("最小日期不合法"),b.checkDate(maxTime)?b.maxDate=maxTime:alert("最大日期不合法")):(b.minDate=minTime,b.maxDate=maxTime);var i=c.createElement("div"),j=void 0==d.zIndex?2099:d.zIndex;i.className="jedatebox "+(b.opts.skinCell||g.skinCell),i.id=b.boxCell.replace(/\#/g,""),b.attr(i,"author","chen guojun--www.jayui.com--version:"+a.version),d.isDisplay&&b.attr(i,"date",!0),i.style.cssText="z-index:"+j+";position:"+(1==b.fixed?"absolute":"fixed")+";display:block;",e.appendChild(i)}},k=function(a){var f,h,i,j,c=d.format||g.format,e=d.initAddVal||g.initAddVal;1==e.length?(f=e[0],h="DD"):(f=e[0],h=e[1]),i=b.nowDate(0,c),j=b.addDateTime(i,f,h,c),""==(b.val(a)||b.text(a))?b.isValHtml(a)?b.val(a,j):b.text(a,j):b.isValHtml(a)?b.val(a):b.text(a)};i&&b.each(f("body "+d.dateCell),function(a,b){k(b)}),e?(b.stopmp(e),j(c.body,b.boxCell),b.elemCell="string"==typeof d.dateCell?f(d.dateCell)[0]:d.dateCell,b.setHtml()):b.bind(f(d.dateCell),"click",function(a){b.stopmp(a),j(c.body,b.boxCell),b.elemCell=this,b.setHtml()})},b.orien=function(a,c,d){var e,f,g,h,i=b.fixed?c.getBoundingClientRect():a.getBoundingClientRect();b.fixed?(f=i.right+a.offsetWidth/1.5>=b.winarea(1)?i.right-a.offsetWidth:i.left+(d?0:b.docScroll(1)),e=i.bottom+a.offsetHeight/1<=b.winarea()?i.bottom-1:i.top>a.offsetHeight/1.5?i.top-a.offsetHeight-1:b.winarea()-a.offsetHeight,g=Math.max(e+(d?0:b.docScroll())+1,1)+"px",h=f+"px"):(g="50%",h="50%",a.style.marginTop=-(i.height/2)+"px",a.style.marginLeft=-(i.width/2)+"px"),a.style.top=g,a.style.left=h},b.dateClose=function(){c.body.removeChild(f(b.boxCell)[0])},b.setHtml=function(){var k,l,m,n,o,p,q,r,s,t,u,v,a="",c="",g=new Date,h=b.checkFormat(b.format),i="YYYY-MM"==h||"YYYY"==h?!0:!1,j="hh-mm"==h.substring(0,5)?!0:!1;""==(b.val(b.elemCell)||b.text(b.elemCell))?(c=[g.getFullYear(),g.getMonth()+1,g.getDate(),g.getHours(),g.getMinutes(),g.getSeconds()],b.currDate=new Date(c[0],e(c[1])-1,c[2],c[3],c[4],c[5]),b.ymdDate=c[0]+"-"+b.digit(c[1])+"-"+b.digit(c[2])):(k=b.isValHtml(b.elemCell)?b.val(b.elemCell):b.text(b.elemCell),l=j?k.replace(/^(\d{2})(?=\d)/g,"$1,"):k.substr(0,4).replace(/^(\d{4})/g,"$1,")+k.substr(4).replace(/^(\d{2})(?=\d)/g,"$1,"),m=b.IsNum(k)?l.match(d):k.match(d),j?(c="hh-mm"==h?[m[0],m[1],g.getSeconds()]:[m[0],m[1],m[2]],b.currDate=new Date(g.getFullYear(),g.getMonth()-1,g.getDate())):(c=[m[0],m[1],m[2],void 0==m[3]?g.getHours():m[3],void 0==m[4]?g.getMinutes():m[4],void 0==m[5]?g.getSeconds():m[5]],b.currDate=new Date(c[0],e(c[1])-1,c[2],c[3],c[4],c[5]),b.ymdDate=c[0]+"-"+b.digit(c[1])+"-"+b.digit(c[2]))),b.currMonth=c[1],b.currDays=c[2],n='<div class="jedatetop">'+(i?'<div class="jedateym" style="width:100%;"><i class="prev triangle ymprev"></i><span class="jedateyy"><em class="jedateyearmonth"></em></span><i class="next triangle ymnext"></i></div>':'<div class="jedateym" style="width:50%;"><i class="prev triangle yearprev"></i><span class="jedateyy" ym="24"><em class="jedateyear"></em><em class="pndrop"></em></span><i class="next triangle yearnext"></i></div><div class="jedateym" style="width:50%;"><i class="prev triangle monthprev"></i><span class="jedatemm" ym="12"><em class="jedatemonth"></em><em class="pndrop"></em></span><i class="next triangle monthnext"></i></div>')+"</div>",o=i?"YYYY"==h?'<ul class="jedayy"></ul>':'<ul class="jedaym"></ul>':'<div class="jedatetopym" style="display: none;"><ul class="ymdropul"></ul><p><span class="jedateymchle">&lt;&lt;</span><span class="jedateymchri">&gt;&gt;</span><span class="jedateymchok">关闭</span></p></div>',p='<ol class="jedaol"></ol><ul class="jedaul"></ul>',q=i?"YYYY"==h?'<div class="botflex jedatebtn"><span class="jedateok" style="width:47.8%">确认</span><span class="jedateclear" style="width:47.8%">清空</span></div>':'<div class="botflex jedatebtn"><span class="jedateok">确认</span><span class="jedatetodaymonth">本月</span><span class="jedateclear">清空</span></div>':'<div class="botflex jedatehmsshde"><ul class="jedatehms"><li><input type="text" /></li><i>:</i><li><input type="text" /></li><i>:</i><li><input type="text" /></li></ul></div><div class="botflex jedatebtn"><span class="jedateok">确认</span><span class="jedatetodaymonth">今天</span><span class="jedateclear">清空</span></div>',r='<div class="jedatebot">'+q+"</div>",s='<div class="jedateprophms '+(j?"jedatepropfix":"jedateproppos")+'"><div class="jedatepropcon"><div class="jedatehmstitle">时间选择<div class="jedatehmsclose">&times;</div></div><div class="jedateproptext">小时</div><div class="jedateproptext">分钟</div><div class="jedateproptext">秒数</div><div class="jedatehmscon jedateprophours"></div><div class="jedatehmscon jedatepropminutes"></div><div class="jedatehmscon jedatepropseconds"></div></div></div>',t=i?n+o+r:j?n+s+r:n+o+p+s+r,b.html(f(b.boxCell)[0],t),b.isBool(b.opts.isClear)?"":b.isShow(b.find(".jedatebot .jedateclear")[0],!1),i||(b.isBool(b.opts.isToday)?"":b.isShow(b.find(".jedatebot .jedatetodaymonth")[0],!1)),/\hh-mm/.test(h)?(u=function(a){var d;d=""!=b.val(b.elemCell)||""!=b.text(b.elemCell)?a?[c[0],c[1],c[2]]:[c[3],c[4],c[5]]:[0,0,0],b.each(b.find(".jedatebot .jedatehms input"),function(a,c){b.val(c,b.digit(d[a])),b.isBool(b.opts.ishmsVal)?"":b.attr(c,"readOnly","true")})},j?(u(!0),b.text(b.find(".jedateyear")[0],b.currDate.getFullYear()+"年").text(b.find(".jedatemonth")[0],b.digit(b.currDate.getMonth()+1)+"月")):b.isBool(b.opts.isTime)?u(!1):(b.isShow(b.find(".jedatebot .jedatehmsshde")[0],!1),b.find(".jedatebot .jedatebtn")[0].style.width="100%")):(i||b.isShow(b.find(".jedatebot .jedatehmsshde")[0],!1),b.find(".jedatebot .jedatebtn")[0].style.width="100%"),/\YYYY-MM-DD/.test(h)&&(b.each(b.weeks,function(b,c){a+='<li class="weeks" data-week="'+c+'">'+c+"</li>"}),b.each(b.find(".jedaol"),function(c,d){b.html(d,a)}),b.createDaysHtml(b.currDate.getFullYear(),b.currDate.getMonth()+1),b.chooseYM()),i&&(v=b.find(".jedateym .jedateyearmonth")[0],"YYYY"==h?(b.attr(v,"data-onyy",c[0]),b.text(v,c[0]+"年"),b.html(b.find(".jedayy")[0],b.onlyYear(c[0]))):(b.attr(v,"data-onym",c[0]+"-"+b.digit(c[1])),b.text(v,c[0]+"年"+e(c[1])+"月"),b.html(b.find(".jedaym")[0],b.onlyYMStr(c[0],e(c[1])))),b.onlyYMevents(c)),b.orien(f(b.boxCell)[0],b.elemCell),setTimeout(function(){b.opts.success&&b.opts.success(b.elemCell)},2),b.events(c)},b.createDaysHtml=function(a,c){var n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,f=e(a),g=e(c),h="",i=0,j=b.minDate.match(d),k=j[0]+j[1]+j[2],l=b.maxDate.match(d),m=l[0]+l[1]+l[2];for(b.html(b.find(".jedaul")[0],""),n=new Date(f,g-1,1).getDay()||7,o=b.getDaysNum(f,g),p=b.getPrevMonth(f,g),q=b.getDaysNum(f,p.m),r=b.getNextMonth(f,g),s=b.currDate.getFullYear()+"-"+b.digit(b.currDate.getMonth()+1)+"-"+b.digit(1),t=f+"-"+b.digit(g)+"-"+b.digit(1),b.attr(b.find(".jedateyear")[0],"year",f),b.text(b.find(".jedateyear")[0],f+"年"),b.attr(b.find(".jedatemonth")[0],"month",g),b.text(b.find(".jedatemonth")[0],g+"月"),u=function(a,c,d){var e=b.opts.marks,f=function(a,b){for(var c=a.length;c--;)if(a[c]===b)return!0;return!1};return b.isType(e,"array")&&e.length>0&&f(e,a+"-"+b.digit(c)+"-"+b.digit(d))?'<i class="marks"></i>':""},v=function(a,c){return b.opts.festival?b.festival(a,c):c},w=function(a,c,d,f){var g=(a+"-"+b.digit(c)+"-"+b.digit(d)).replace(/\-/g,"");if(f){if(e(g)>=e(k)&&e(g)<=e(m))return!0}else if(e(k)>e(g)||e(m)<e(g))return!0},x=q-n+1;q>=x;x++,i++)y=u(p.y,p.m,x),z=w(p.y,p.m,x,!1)?"disabled":"other",h+='<li year="'+p.y+'" month="'+p.m+'" day="'+x+'" class='+z+">"+(v(p.m+"."+x,x)+y)+"</li>";for(A=1;o>=A;A++,i++)B="",C=u(f,g,A),D=f+"-"+b.digit(g)+"-"+b.digit(A),B=w(f,g,A,!0)?b.ymdDate==D?"action":s!=t&&t==D?"action":"":"disabled",h+='<li year="'+f+'" month="'+g+'" day="'+A+'" '+(""!=B?"class="+B:"")+">"+(v(g+"."+A,A)+C)+"</li>";for(E=1,F=42-i;F>=E;E++)G=u(r.y,r.m,E),H=w(r.y,r.m,E,!1)?"disabled":"other",h+='<li year="'+r.y+'" month="'+r.m+'" day="'+E+'" class='+H+">"+(v(r.m+"."+E,E)+G)+"</li>";b.html(b.find(".jedaul")[0],h),b.chooseDays()},b.onlyYMStr=function(a,c){var d="";return b.each(b.montharr,function(e,f){var g=b.parseMatch(b.minDate),h=b.parseMatch(b.maxDate),i=new Date(a,b.digit(f),"01"),j=new Date(g[0],g[1],g[2]),k=new Date(h[0],h[1],h[2]);d+=j>i||i>k?"<li class='disabled' ym='"+a+"-"+b.digit(f)+"'>"+a+"年"+b.digit(f)+"月</li>":"<li "+(c==f?'class="action"':"")+' ym="'+a+"-"+b.digit(f)+'">'+a+"年"+b.digit(f)+"月</li>"}),d},b.onlyYear=function(a){var c="";return b.yearArr=new Array(15),b.each(b.yearArr,function(d){var e=b.parseMatch(b.minDate),f=b.parseMatch(b.maxDate),g=e[0],h=f[0],i=a-7+d,j=b.attr(b.find(".jedateym .jedateyearmonth")[0],"data-onyy");c+=g>i||i>h?"<li class='disabled' yy='"+i+"'>"+i+"年</li>":"<li "+(j==i?'class="action"':"")+" yy='"+i+"'>"+i+"年</li>"}),c},b.setStrhms=function(){var k,l,m,n,a=b.format,c=[],f=b.find(".jedatehms li"),g=b.find(".jedatepropcon .jedateproptext"),h=b.find(".jedatepropcon .jedatehmscon"),i=function(a){var b=a.match(d).join("-"),c="YYYY-MM-DD-hh-mm"==b?a.split(" "):b,e="YYYY-MM-DD-hh-mm"==b?c[1]:c;return e.match(d).join("-")},j="hh-mm"==i(a);return j&&(k=b.getStyle(f[0],"width").replace(/\px|em|rem/g,""),l=b.getStyle(b.find(".jedatehms i")[0],"width").replace(/\px|em|rem/g,""),m=b.getStyle(g[0],"width").replace(/\px|em|rem/g,""),n=Math.round(e(k)+e(k)/2+e(l)/2),f[0].style.width=f[1].style.width=n+"px",g[0].style.width=g[1].style.width=h[0].style.width=h[1].style.width=Math.round(e(m)+e(m)/2+2)+"px"),b.each([24,60,60],function(a,d){var m,n,e="",i="",k=b.find(".jedatehms input"),l=b.val(k[a]);for(b.attr(k[a],"maxlength",2).attr(k[a],"numval",d-1).attr(k[a],"item",a),m=0;d>m;m++)m=b.digit(m),b.opts.ishmsLimit?i=l>m?"disabled":m==l?"action":"":(i=j&&2==a?l==m?"disabled action":"disabled":l==m?"action":"",j&&2==a&&(n=f[2],n.style.display=n.previousSibling.style.display="none",g[a].style.display=h[a].style.display="none")),e+='<p class="'+i+'">'+m+"</p>";c.push(e)}),c},b.onlyYMevents=function(a){var c,d=b.find(".jedateym .ymprev"),f=b.find(".jedateym .ymnext"),g=e(a[0]),h=parseFloat(a[1]);b.each([d,f],function(a,f){b.bind(f,"click",function(a){b.stopmp(a),"YYYY"==b.checkFormat(b.format)?(c=f==d?b.attr(b.find(".jedayy li")[0],"yy"):b.attr(b.find(".jedayy li")[b.yearArr.length-1],"yy"),b.html(b.find(".jedayy")[0],b.onlyYear(e(c)))):(c=f==d?g-=1:g+=1,b.html(b.find(".jedaym")[0],b.onlyYMStr(c,h))),b.ymPremNextEvents()})})},b.chooseDays=function(){b.bind(b.find(".jedaul li"),"click",function(a){var g,h,i,j,c=this,d=[],f=b.elemCell;b.hasClass(c,"disabled")||(b.stopmp(a),b.each(b.find(".jedatehms input"),function(a,c){d.push(b.val(c))}),g=e(b.attr(c,"year")),h=parseFloat(b.attr(c,"month")),i=parseFloat(b.attr(c,"day")),j=b.parse([g,h,i],[d[0],d[1],d[2]],b.format),b.isValHtml(f)?b.val(f,j):b.text(f,j),b.dateClose(),(b.isType(b.opts.choosefun,"function")||null!=b.opts.choosefun)&&b.opts.choosefun&&b.opts.choosefun(b.elemCell,j))})},b.chooseYM=function(){function k(a){var c="";return b.each(new Array(15),function(d){if(7===d){var e=b.attr(f[0],"year");c+="<li "+(e==a?'class="action"':"")+' yy="'+a+'">'+a+"年</li>"}else c+='<li yy="'+(a-7+d)+'">'+(a-7+d)+"年</li>"}),c}function l(c,d){var e="";12==d?(b.each(b.montharr,function(a,c){var d=b.attr(g[0],"month"),c=b.digit(c);e+="<li "+(b.digit(d)==c?'class="action"':"")+' mm="'+c+'">'+c+"月</li>"}),b.each([h,i],function(a,c){b.isShow(c[0],!1)})):(e=k(c),b.each([h,i],function(a,c){b.isShow(c[0],!0)})),b.removeClass(a[0],12==d?"jedatesety":"jedatesetm").addClass(a[0],12==d?"jedatesetm":"jedatesety"),b.html(b.find(".jedatetopym .ymdropul")[0],e),b.isShow(a[0],!0)}function m(c){b.bind(b.find(".ymdropul li"),"click",function(){var f=b.attr(this,"yy"),h=e(b.attr(g[0],"month"));b.attr(c,"year",f),b.html(c,f+"年"),b.isShow(a[0],!1),b.createDaysHtml(f,h)})}var n,a=b.find(".jedatetopym"),c=b.find(".jedateyy"),d=b.find(".jedatemm"),f=b.find(".jedateyy .jedateyear"),g=b.find(".jedatemm .jedatemonth"),h=b.find(".jedateymchri"),i=b.find(".jedateymchle"),j="hh-mm"==b.checkFormat(b.format).substring(0,5)?!0:!1;!j&&b.bind(c,"click",function(){var a=e(b.attr(this,"ym")),c=e(b.attr(f[0],"year"));l(c,a),m(f[0])}),!j&&b.bind(d,"click",function(){var c=e(b.attr(this,"ym")),d=e(b.attr(f[0],"year"));l(d,c),b.bind(b.find(".ymdropul li"),"click",function(){var d=b.attr(f[0],"year"),h=e(b.attr(this,"mm"));b.attr(g[0],"month",h),b.html(g[0],h+"月"),b.isShow(a[0],!1),b.createDaysHtml(d,h)})}),b.bind(b.find(".jedateymchok"),"click",function(c){b.stopmp(c),b.isShow(a[0],!1)}),n=e(b.attr(f[0],"year")),b.each([i,h],function(a,c){b.bind(c,"click",function(c){b.stopmp(c),0==a?n-=15:n+=15;var d=k(n);b.html(b.find(".jedatetopym .ymdropul")[0],d),m(f[0])})})},b.ymPremNextEvents=function(){var a=new Date,c=b.elemCell,e="YYYY"==b.checkFormat(b.format),f=e?b.find(".jedayy li"):b.find(".jedaym li");b.bind(f,"click",function(f){var h,i,g=this;b.hasClass(g,"disabled")||(b.stopmp(f),h=e?b.attr(g,"yy").match(d):b.attr(g,"ym").match(d),i=e?b.parse([h[0],a.getMonth()+1,1],[0,0,0],b.format):b.parse([h[0],h[1],1],[0,0,0],b.format),b.isValHtml(c)?b.val(c,i):b.text(c,i),b.dateClose(),(b.isType(b.opts.choosefun,"function")||null!=b.opts.choosefun)&&b.opts.choosefun(b.elemCell,i))})},b.events=function(a){var q,r,s,t,u,v,h=new Date,i=b.find(".yearprev"),j=b.find(".yearnext"),k=b.find(".monthprev"),l=b.find(".monthnext"),m=b.find(".jedateyear"),n=b.find(".jedatemonth"),o="YYYY-MM"==b.checkFormat(b.format)||"YYYY"==b.checkFormat(b.format)?!0:!1,p="hh-mm"==b.checkFormat(b.format).substring(0,5)?!0:!1;o?(v=b.elemCell,b.ymPremNextEvents(),b.bind(b.find(".jedatebot .jedatetodaymonth"),"click",function(a){b.stopmp(a);var c=[h.getFullYear(),h.getMonth()+1,h.getDate()],d=b.parse([c[0],c[1],0],[0,0,0],b.format);b.isValHtml(v)?b.val(v,d):b.text(v,d),b.dateClose(),(b.isType(b.opts.choosefun,"function")||null!=b.opts.choosefun)&&b.opts.choosefun(b.elemCell,d)})):(!p&&b.each([i,j],function(a,c){b.bind(c,"click",function(a){b.stopmp(a);var d=e(b.attr(m[0],"year")),f=e(b.attr(n[0],"month")),g=c==i?--d:++d,h=b.getPrevMonth(g,f),j=b.getNextMonth(g,f);c==i?b.createDaysHtml(h.y,f):b.createDaysHtml(j.y,f)})}),!p&&b.each([k,l],function(a,c){b.bind(c,"click",function(a){b.stopmp(a);var d=e(b.attr(m[0],"year")),f=e(b.attr(n[0],"month")),g=b.getPrevMonth(d,f),h=b.getNextMonth(d,f);c==k?b.createDaysHtml(g.y,g.m):b.createDaysHtml(h.y,h.m)})}),q=b.setStrhms(),r=function(a){b.each(a,function(a,c){""==b.html(c[0])&&b.html(c[0],q[a])}),p?(b.isShow(b.find(".jedatehmsclose")[0],!1),b.isShow(b.find(".jedatetodaymonth")[0],!1)):b.isShow(b.find(".jedateprophms")[0],!0),b.each(["hours","minutes","seconds"],function(a,c){var f,d=b.find(".jedateprop"+c),e=b.find(".jedateprop"+c+" .action");d[0].scrollTop=e[0].offsetTop-118,f=b.find(".jedateprop"+c+" p"),b.bind(f,"click",function(){var c=this;b.hasClass(c,"disabled")||(b.each(f,function(a,c){b.removeClass(c,"action")}),b.addClass(c,"action"),b.val(b.find(".jedatebot .jedatehms input")[a],b.digit(b.text(c))),p||b.isShow(b.find(".jedateprophms")[0],!1))})})},s=b.find(".jedateprophours"),t=b.find(".jedatepropminutes"),u=b.find(".jedatepropseconds"),p?r([s,t,u]):b.bind(b.find(".jedatehms"),"click",function(){"block"!==b.find(".jedateprophms")[0].style.display&&r([s,t,u]),b.bind(b.find(".jedateprophms .jedatehmsclose"),"click",function(){b.isShow(b.find(".jedateprophms")[0],!1)})}),b.bind(b.find(".jedatebot .jedatetodaymonth"),"click",function(){var a=[h.getFullYear(),h.getMonth()+1,h.getDate(),h.getHours(),h.getMinutes(),h.getSeconds()],c=b.parse([a[0],a[1],a[2]],[a[3],a[4],a[5]],b.format),d=b.elemCell;b.createDaysHtml(a[0],a[1]),b.isValHtml(d)?b.val(d,c):b.text(d,c),b.dateClose(),(b.isType(b.opts.choosefun,"function")||null!=b.opts.choosefun)&&b.opts.choosefun(b.elemCell,c),o||b.chooseDays()})),b.bind(b.find(".jedatehms input"),"keyup",function(){var a=this,c=a.value,d=e(b.attr(a,"numval")),f=e(b.attr(a,"item"));b.val(a,c.replace(/\D/g,"")),a.value>d&&(b.val(a,d),alert("输入值不能大于"+d)),""==this.value&&b.val(a,"00"),b.each(b.find(".jedatehmscon")[f].childNodes,function(a,c){b.removeClass(c,"action")}),b.addClass(b.find(".jedatehmscon")[f].childNodes[e(a.value.replace(/^0/g,""))],"action"),b.each(["hours","minutes","seconds"],function(a,c){var d=b.find(".jedateprop"+c),e=b.find(".jedateprop"+c+" .action");d[0].scrollTop=e[0].offsetTop-118})}),b.bind(b.find(".jedatebot .jedateclear"),"click",function(a){b.stopmp(a);var c=b.elemCell,d=b.isValHtml(c)?b.val(c):b.text(c);b.isValHtml(c)?b.val(c,""):b.text(c,""),b.dateClose(),""!=d&&(b.isBool(b.opts.clearRestore)&&(b.opts.minDate=b.opts.startMin||g.startMin,b.opts.maxDate=b.opts.startMax||g.startMax),(b.isType(b.opts.clearfun,"function")||null!=b.opts.clearfun)&&b.opts.clearfun(b.elemCell,d))}),b.bind(b.find(".jedatebot .jedateok"),"click",function(c){var f,g,i,j,k,l,q,r,s,t,u,v,w,x;b.stopmp(c),f=b.elemCell,g=""!=(b.val(f)||b.text(f)),i="YYYY"==b.checkFormat(b.format),j="",k=function(){var a=[];return b.each(b.find(".jedatehms input"),function(c,d){a.push(b.val(d))}),a},g?(l=b.isValHtml(f)?b.val(f):b.text(f),q=l.match(d),o?(t=i?b.find(".jedayy .action")[0]:b.find(".jedaym .action")[0],i?(u=t?b.attr(t,"yy").match(d):q,j=b.parse([e(u[0]),h.getMonth()+1,1],[0,0,0],b.format)):(v=t?b.attr(t,"ym").match(d):q,j=b.parse([e(v[0]),e(v[1]),1],[0,0,0],b.format))):(r=k(),s=[e(b.attr(m[0],"year")),e(b.attr(n[0],"month")),q[2]],j=g?b.parse([s[0],s[1],s[2]],[r[0],r[1],r[2]],b.format):"",p||b.createDaysHtml(s[0],s[1]),b.chooseDays())):(w=k(),x=b.find(".jedateyearmonth")[0],u="",p?j=b.parse([a[0],a[1],a[2]],[w[0],w[1],w[2]],b.format):(u=o?"YYYY"==b.checkFormat(b.format)?b.attr(x,"data-onyy").match(d):b.attr(x,"data-onym").match(d):[h.getFullYear(),h.getMonth()+1,h.getDate()],j=i?b.parse([e(u[0]),h.getMonth()+1,1],[0,0,0],b.format):b.parse([e(u[0]),e(u[1]),h.getDate()],[w[0],w[1],w[2]],b.format))),b.isValHtml(f)?b.val(f,j):b.text(f,j),b.dateClose(),(b.isType(b.opts.okfun,"function")||null!=b.opts.okfun)&&b.opts.okfun(b.elemCell,j)}),b.bind(document,"mouseup",function(a){b.stopmp(a);var d=f(b.boxCell)[0];d&&"none"!==d.style.display&&c.body.removeChild(d)}),b.bind(f(b.boxCell),"mouseup",function(a){b.stopmp(a)})},a=function(c){try{b.event=window.event?window.event:a.caller.arguments[0]}catch(d){}return new b.initDate(c||{})},a.version="3.4",a.now=function(a){return b.nowDate(a)},a.addDate=function(a,c,d){return c=0|c,d=d||"DD",b.addDateTime(a,c,d,b.format)},a});