META-INF.web.lib.laydate.laydate.js Maven / Gradle / Ivy
/*! layDate v5.3.1 | 日期与时间组件 | MIT Licensed */
;!function(y){var d=y.document,n={modules:{},status:{},timeout:10,event:{}},i=function(){this.v="2.6.7"},s=y.LAYUI_GLOBAL||{},f=function(){var b=d.currentScript?d.currentScript.src:function(){for(var h,g=d.scripts,k=g.length-1,j=k;j>0;j--){if("interactive"===g[j].readyState){h=g[j].src;break}}return h||g[k].src}();return n.dir=s.dir||b.substring(0,b.lastIndexOf("/")+1)}(),o=function(b,g){g=g||"log",y.console&&console[g]&&console[g]("layui error hint: "+b)},l="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),a=n.builtin={lay:"lay",layer:"layer",laydate:"laydate",laypage:"laypage",laytpl:"laytpl",layedit:"layedit",form:"form",upload:"upload",dropdown:"dropdown",transfer:"transfer",tree:"tree",table:"table",element:"element",rate:"rate",colorpicker:"colorpicker",slider:"slider",carousel:"carousel",flow:"flow",util:"util",code:"code",jquery:"jquery",all:"all","layui.all":"layui.all"};i.prototype.cache=n,i.prototype.define=function(b,h){var k=this,g="function"==typeof b,j=function(){var p=function(v,q){e[v]=q,n.status[v]=!0};return"function"==typeof h&&h(function(v,q){p(v,q),n.callback[v]=function(){h(p)}}),this};return g&&(h=b,b=[]),k.use(b,j,null,"define"),k},i.prototype.use=function(v,j,A,w){function B(D,F){var G="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===D.type||G.test((D.currentTarget||D.srcElement).readyState))&&(n.modules[z]=F,h.removeChild(q),function E(){return ++p>1000*n.timeout/4?o(z+" is not a valid module","error"):void (n.status[z]?g():setTimeout(E,4))}())}function g(){A.push(e[z]),v.length>1?x.use(v.slice(1),j,A,w):"function"==typeof j&&function(){return e.jquery&&"function"==typeof e.jquery&&"define"!==w?e.jquery(function(){j.apply(e,A)}):void j.apply(e,A)}()}var x=this,C=n.dir=n.dir?n.dir:f,h=d.getElementsByTagName("head")[0];v=function(){return"string"==typeof v?[v]:"function"==typeof v?(j=v,["all"]):v}(),y.jQuery&&jQuery.fn.on&&(x.each(v,function(E,D){"jquery"===D&&v.splice(E,1)}),e.jquery=e.$=jQuery);var z=v[0],p=0;if(A=A||[],n.host=n.host||(C.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===v.length||e["layui.all"]&&a[z]){return g(),x}var b=(a[z]?C+"modules/":/^\{\/\}/.test(x.modules[z])?"":n.base||"")+(x.modules[z]||z)+".js";if(b=b.replace(/^\{\/\}/,""),!n.modules[z]&&e[z]&&(n.modules[z]=b),n.modules[z]){!function k(){return ++p>1000*n.timeout/4?o(z+" is not a valid module","error"):void ("string"==typeof n.modules[z]&&n.status[z]?g():setTimeout(k,4))}()}else{var q=d.createElement("script");q.async=!0,q.charset="utf-8",q.src=b+function(){var D=n.version===!0?n.v||(new Date).getTime():n.version||"";return D?"?v="+D:""}(),h.appendChild(q),!q.attachEvent||q.attachEvent.toString&&q.attachEvent.toString().indexOf("[native code")<0||l?q.addEventListener("load",function(D){B(D,b)},!1):q.attachEvent("onreadystatechange",function(D){B(D,b)}),n.modules[z]=b}return x},i.prototype.getStyle=function(g,b){var h=g.currentStyle?g.currentStyle:y.getComputedStyle(g,null);return h[h.getPropertyValue?"getPropertyValue":"getAttribute"](b)},i.prototype.link=function(z,p,h){var x=this,b=d.getElementsByTagName("head")[0],j=d.createElement("link");"string"==typeof p&&(h=p);var v=(h||z).replace(/\.|\//g,""),k=j.id="layuicss-"+v,q="creating",w=0;return j.rel="stylesheet",j.href=z+(n.debug?"?v="+(new Date).getTime():""),j.media="all",d.getElementById(k)||b.appendChild(j),"function"!=typeof p?x:(function g(B){var A=100,C=d.getElementById(k);return ++w>1000*n.timeout/A?o(z+" timeout"):void (1989===parseInt(x.getStyle(C,"width"))?(B===q&&C.removeAttribute("lay-status"),C.getAttribute("lay-status")===q?setTimeout(g,A):p()):(C.setAttribute("lay-status",q),setTimeout(function(){g(q)},A)))}(),x)},i.prototype.addcss=function(b,g,h){return e.link(n.dir+"css/"+b,g,h)},n.callback={},i.prototype.factory=function(b){if(e[b]){return"function"==typeof n.callback[b]?n.callback[b]:null}},i.prototype.img=function(g,h,b){var j=new Image;return j.src=g,j.complete?h(j):(j.onload=function(){j.onload=null,"function"==typeof h&&h(j)},void (j.onerror=function(k){j.onerror=null,"function"==typeof b&&b(k)}))},i.prototype.config=function(g){g=g||{};for(var b in g){n[b]=g[b]}return this},i.prototype.modules=function(){var g={};for(var b in a){g[b]=a[b]}return g}(),i.prototype.extend=function(h){var b=this;h=h||{};for(var g in h){b[g]||b.modules[g]?o(g+" Module already exists","error"):b.modules[g]=h[g]}return b},i.prototype.router=function(h){var b=this,h=h||location.hash,g={path:[],search:{},hash:(h.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(h)?(h=h.replace(/^#\//,""),g.href="/"+h,h=h.replace(/([^#])(#.*$)/,"$1").split("/")||[],b.each(h,function(j,k){/^\w+=/.test(k)?function(){k=k.split("="),g.search[k[0]]=k[1]}():g.path.push(k)}),g):g},i.prototype.url=function(h){var b=this,g={pathname:function(){var j=h?function(){var k=(h.match(/\.[^.]+?\/.+/)||[])[0]||"";return k.replace(/^[^\/]+/,"").replace(/\?.+/,"")}():location.pathname;return j.replace(/^\//,"").split("/")}(),search:function(){var j={},k=(h?function(){var p=(h.match(/\?.+/)||[])[0]||"";return p.replace(/\#.+/,"")}():location.search).replace(/^\?+/,"").split("&");return b.each(k,function(w,q){var v=q.indexOf("="),p=function(){return v<0?q.substr(0,q.length):0!==v&&q.substr(0,v)}();p&&(j[p]=v>0?q.substr(v+1):null)}),j}(),hash:b.router(function(){return h?(h.match(/#.+/)||[])[0]||"/":location.hash}())};return g},i.prototype.data=function(h,b,k){if(h=h||"layui",k=k||localStorage,y.JSON&&y.JSON.parse){if(null===b){return delete k[h]}b="object"==typeof b?b:{key:b};try{var g=JSON.parse(k[h])}catch(j){var g={}}return"value" in b&&(g[b.key]=b.value),b.remove&&delete g[b.key],k[h]=JSON.stringify(g),b.key?g[b.key]:g}},i.prototype.sessionData=function(g,b){return this.data(g,b,sessionStorage)},i.prototype.device=function(h){var b=navigator.userAgent.toLowerCase(),j=function(p){var k=new RegExp(p+"/([^\\s\\_\\-]+)");return p=(b.match(k)||[])[1],p||!1},g={os:function(){return/windows/.test(b)?"windows":/linux/.test(b)?"linux":/iphone|ipod|ipad|ios/.test(b)?"ios":/mac/.test(b)?"mac":void 0}(),ie:function(){return !!(y.ActiveXObject||"ActiveXObject" in y)&&((b.match(/msie\s(\d+)/)||[])[1]||"11")}(),weixin:j("micromessenger")};return h&&!g[h]&&(g[h]=j(h)),g.android=/android/.test(b),g.ios="ios"===g.os,g.mobile=!(!g.android&&!g.ios),g},i.prototype.hint=function(){return{error:o}},i.prototype._typeof=function(b){return null===b?String(b):"object"==typeof b||"function"==typeof b?function(){var h=Object.prototype.toString.call(b).match(/\s(.+)\]$/)||[],g="Function|Array|Date|RegExp|Object|Error|Symbol";return h=h[1]||"Object",new RegExp("\\b("+g+")\\b").test(h)?h.toLowerCase():"object"}():typeof b},i.prototype._isArray=function(h){var b,j=this,g=j._typeof(h);return !(!h||"object"!=typeof h||h===y)&&(b="length" in h&&h.length,"array"===g||0===b||"number"==typeof b&&b>0&&b-1 in h)},i.prototype.each=function(g,j){var b,k=this,h=function(q,p){return j.call(p[q],q,p[q])};if("function"!=typeof j){return k}if(g=g||[],k._isArray(g)){for(b=0;b(window.innerHeight||u.documentElement.clientHeight)},m.position=function(w,h,B){if(h){B=B||{},w!==u&&w!==m("body")[0]||(B.clickType="right");var p="right"===B.clickType?function(){var C=B.e||window.event||{};return{left:C.clientX,top:C.clientY,right:C.clientX,bottom:C.clientY}}():w.getBoundingClientRect(),k=h.offsetWidth,z=h.offsetHeight,b=function(C){return C=C?"scrollLeft":"scrollTop",u.body[C]|u.documentElement[C]},A=function(C){return u.documentElement[C?"clientWidth":"clientHeight"]},g=5,v=p.left,j=p.bottom;v+k+g>A("width")&&(v=A("width")-k-g),j+z+g>A()&&(p.top>z+g?j=p.top-z-2*g:"right"===B.clickType&&(j=A()-z-2*g,j<0&&(j=0)));var q=B.position;if(q&&(h.style.position=q),h.style.left=v+("fixed"===q?0:b(1))+"px",h.style.top=j+("fixed"===q?0:b())+"px",!m.hasScrollbar()){var x=h.getBoundingClientRect();!B.SYSTEM_RELOAD&&x.bottom+g>A()&&(B.SYSTEM_RELOAD=!0,setTimeout(function(){m.position(w,h,B)},50))}}},m.options=function(g,j){var b=m(g),k=j||"lay-options";try{return new Function("return "+(b.attr(k)||"{}"))()}catch(h){return hint.error("parseerror\uff1a"+h,"error"),{}}},m.isTopElem=function(h){var b=[u,m("body")[0]],g=!1;return m.each(b,function(j,k){if(k===h){return g=!0}}),g},c.addStr=function(g,b){return g=g.replace(/\s+/," "),b=b.replace(/\s+/," ").split(" "),m.each(b,function(j,h){new RegExp("\\b"+h+"\\b").test(g)||(g=g+" "+h)}),g.replace(/^\s|\s$/,"")},c.removeStr=function(g,b){return g=g.replace(/\s+/," "),b=b.replace(/\s+/," ").split(" "),m.each(b,function(j,h){var k=new RegExp("\\b"+h+"\\b");k.test(g)&&(g=g.replace(k,""))}),g.replace(/\s+/," ").replace(/^\s|\s$/,"")},c.prototype.find=function(g){var j=this,b=0,k=[],h="object"==typeof g;return this.each(function(v,p){for(var q=h?p.contains(g):p.querySelectorAll(g||null);b0){return b[0].style[g]}}():b.each(function(p,k){"object"==typeof g?m.each(g,function(q,v){k.style[q]=j(v)}):k.style[g]=j(h)})},c.prototype.width=function(g){var b=this;return void 0===g?function(){if(b.length>0){return b[0].offsetWidth}}():b.each(function(h,j){b.css("width",g)})},c.prototype.height=function(g){var b=this;return void 0===g?function(){if(b.length>0){return b[0].offsetHeight}}():b.each(function(h,j){b.css("height",g)})},c.prototype.attr=function(h,b){var g=this;return void 0===b?function(){if(g.length>0){return g[0].getAttribute(h)}}():g.each(function(j,k){k.setAttribute(h,b)})},c.prototype.removeAttr=function(b){return this.each(function(h,g){g.removeAttribute(b)})},c.prototype.html=function(g){var b=this;return void 0===g?function(){if(b.length>0){return b[0].innerHTML}}():this.each(function(j,h){h.innerHTML=g})},c.prototype.val=function(g){var b=this;return void 0===g?function(){if(b.length>0){return b[0].value}}():this.each(function(j,h){h.value=g})},c.prototype.append=function(b){return this.each(function(h,g){"object"==typeof b?g.appendChild(b):g.innerHTML=g.innerHTML+b})},c.prototype.remove=function(b){return this.each(function(h,g){b?g.removeChild(b):g.parentNode.removeChild(g)})},c.prototype.on=function(g,b){return this.each(function(h,j){j.attachEvent?j.attachEvent("on"+g,function(k){k.target=k.srcElement,b.call(j,k)}):j.addEventListener(g,b,!1)})},c.prototype.off=function(g,b){return this.each(function(h,j){j.detachEvent?j.detachEvent("on"+g,b):j.removeEventListener(g,b,!1)})},window.lay=m,window.layui&&e.define&&e.define(function(b){b(r,m)})}(window,window.document),!function(e,i){var p=e.layui&&layui.define,a={getPath:e.lay&&lay.getPath?lay.getPath:"",link:function(j,b,k){l.path&&e.lay&&lay.layui&&lay.layui.link(l.path+j,b,k)}},t=e.LAYUI_GLOBAL||{},l={v:"5.3.1",config:{},index:e.laydate&&e.laydate.v?100000:0,path:t.laydate_dir||a.getPath,set:function(j){var b=this;return b.config=lay.extend({},b.config,j),b},ready:function(k){var b="laydate",q="",j=(p?"modules/laydate/":"theme/")+"default/laydate.css?v="+l.v+q;return p?layui.addcss(j,k,b):a.link(j,k,b),this}},r=function(){var k=this,b=k.config,j=b.id;return r.that[j]=k,{hint:function(q){k.hint.call(k,q)},config:k.config}},m="laydate",v=".layui-laydate",c="layui-this",n="laydate-disabled",D=[100,200000],d="layui-laydate-static",o="layui-laydate-list",f="layui-laydate-hint",h="layui-laydate-footer",s=".laydate-btns-confirm",g="laydate-time-text",u="laydate-btns-time",R="layui-laydate-preview",y=function(j){var b=this;b.index=++l.index,b.config=lay.extend({},b.config,l.config,j),j=b.config,j.id="id" in j?j.id:b.index,l.ready(function(){b.init()})},w="yyyy|y|MM|M|dd|d|HH|H|mm|m|ss|s";r.formatArr=function(b){return(b||"").match(new RegExp(w+"|.","g"))||[]},y.isLeapYear=function(b){return b%4===0&&b%100!==0||b%400===0},y.prototype.config={type:"date",range:!1,format:"yyyy-MM-dd",value:null,isInitValue:!0,min:"1900-1-1",max:"2099-12-31",trigger:"click",show:!1,showBottom:!0,isPreview:!0,btns:["clear","now","confirm"],lang:"cn",theme:"default",position:null,calendar:!1,mark:{},zIndex:null,done:null,change:null},y.prototype.lang=function(){var k=this,b=k.config,j={cn:{weeks:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"],time:["\u65f6","\u5206","\u79d2"],timeTips:"\u9009\u62e9\u65f6\u95f4",startTime:"\u5f00\u59cb\u65f6\u95f4",endTime:"\u7ed3\u675f\u65f6\u95f4",dateTips:"\u8fd4\u56de\u65e5\u671f",month:["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"],tools:{confirm:"\u786e\u5b9a",clear:"\u6e05\u7a7a",now:"\u73b0\u5728"},timeout:"\u7ed3\u675f\u65f6\u95f4\u4e0d\u80fd\u65e9\u4e8e\u5f00\u59cb\u65f6\u95f4
\u8bf7\u91cd\u65b0\u9009\u62e9",invalidDate:"\u4e0d\u5728\u6709\u6548\u65e5\u671f\u6216\u65f6\u95f4\u8303\u56f4\u5185",formatError:["\u65e5\u671f\u683c\u5f0f\u4e0d\u5408\u6cd5
\u5fc5\u987b\u9075\u5faa\u4e0b\u8ff0\u683c\u5f0f\uff1a
","
\u5df2\u4e3a\u4f60\u91cd\u7f6e"],preview:"\u5f53\u524d\u9009\u4e2d\u7684\u7ed3\u679c"},en:{weeks:["Su","Mo","Tu","We","Th","Fr","Sa"],time:["Hours","Minutes","Seconds"],timeTips:"Select Time",startTime:"Start Time",endTime:"End Time",dateTips:"Select Date",month:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],tools:{confirm:"Confirm",clear:"Clear",now:"Now"},timeout:"End time cannot be less than start Time
Please re-select",invalidDate:"Invalid date",formatError:["The date format error
Must be followed\uff1a
","
It has been reset"],preview:"The selected result"}};return j[b.lang]||j.cn},y.prototype.init=function(){var k=this,b=k.config,q="static"===b.position,j={year:"yyyy",month:"yyyy-MM",date:"yyyy-MM-dd",time:"HH:mm:ss",datetime:"yyyy-MM-dd HH:mm:ss"};b.elem=lay(b.elem),b.eventElem=lay(b.eventElem),b.elem[0]&&(k.rangeStr=b.range?"string"==typeof b.range?b.range:"-":"",b.range&&b.range.constructor===Array&&(k.rangeElem=[lay(b.range[0]),lay(b.range[1])]),j[b.type]||(e.console&&console.error&&console.error("laydate type error:'"+b.type+"' is not supported"),b.type="date"),b.format===j.date&&(b.format=j[b.type]||j.date),k.format=r.formatArr(b.format),k.EXP_IF="",k.EXP_SPLIT="",lay.each(k.format,function(z,x){var A=new RegExp(w).test(x)?"\\d{"+function(){return new RegExp(w).test(k.format[0===z?z+1:z-1]||"")?/^yyyy|y$/.test(x)?4:x.length:/^yyyy$/.test(x)?"1,4":/^y$/.test(x)?"1,308":"1,2"}()+"}":"\\"+x;k.EXP_IF=k.EXP_IF+A,k.EXP_SPLIT=k.EXP_SPLIT+"("+A+")"}),k.EXP_IF_ONE=new RegExp("^"+k.EXP_IF+"$"),k.EXP_IF=new RegExp("^"+(b.range?k.EXP_IF+"\\s\\"+k.rangeStr+"\\s"+k.EXP_IF:k.EXP_IF)+"$"),k.EXP_SPLIT=new RegExp("^"+k.EXP_SPLIT+"$",""),k.isInput(b.elem[0])||"focus"===b.trigger&&(b.trigger="click"),b.elem.attr("lay-key")||(b.elem.attr("lay-key",k.index),b.eventElem.attr("lay-key",k.index)),b.mark=lay.extend({},b.calendar&&"cn"===b.lang?{"0-1-1":"\u5143\u65e6","0-2-14":"\u60c5\u4eba","0-3-8":"\u5987\u5973","0-3-12":"\u690d\u6811","0-4-1":"\u611a\u4eba","0-5-1":"\u52b3\u52a8","0-5-4":"\u9752\u5e74","0-6-1":"\u513f\u7ae5","0-9-10":"\u6559\u5e08","0-9-18":"\u56fd\u803b","0-10-1":"\u56fd\u5e86","0-12-25":"\u5723\u8bde"}:{},b.mark),lay.each(["min","max"],function(A,G){var C=[],B=[];if("number"==typeof b[G]){var x=b[G],z=(new Date).getTime(),E=86400000,F=new Date(x?x0){return !0}var N=lay.elem("div",{"class":"layui-laydate-header"}),L=[function(){var O=lay.elem("i",{"class":"layui-icon laydate-icon laydate-prev-y"});return O.innerHTML="",O}(),function(){var O=lay.elem("i",{"class":"layui-icon laydate-icon laydate-prev-m"});return O.innerHTML="",O}(),function(){var P=lay.elem("div",{"class":"laydate-set-ym"}),Q=lay.elem("span"),O=lay.elem("span");return P.appendChild(Q),P.appendChild(O),P}(),function(){var O=lay.elem("i",{"class":"layui-icon laydate-icon laydate-next-m"});return O.innerHTML="",O}(),function(){var O=lay.elem("i",{"class":"layui-icon laydate-icon laydate-next-y"});return O.innerHTML="",O}()],I=lay.elem("div",{"class":"layui-laydate-content"}),M=lay.elem("table"),K=lay.elem("thead"),H=lay.elem("tr");lay.each(L,function(P,O){N.appendChild(O)}),K.appendChild(H),lay.each(new Array(6),function(O){var P=M.insertRow(0);lay.each(new Array(7),function(Q){if(0===O){var S=lay.elem("th");S.innerHTML=z.weeks[Q],H.appendChild(S)}P.insertCell(Q)})}),M.insertBefore(K,M.children[0]),I.appendChild(M),j[J]=lay.elem("div",{"class":"layui-laydate-main laydate-main-list-"+J}),j[J].appendChild(N),j[J].appendChild(I),k.push(L),E.push(I),q.push(M)}),lay(b).html(function(){var I=[],H=[];return"datetime"===A.type&&I.push(''+z.timeTips+""),(A.range||"datetime"!==A.type)&&I.push(''),lay.each(A.btns,function(K,L){var J=z.tools[L]||"btn";A.range&&"now"===L||(C&&"clear"===L&&(J="cn"===A.lang?"\u91cd\u7f6e":"Reset"),H.push(''+J+""))}),I.push(' "),I.join("")}()),lay.each(j,function(I,H){B.appendChild(H)}),A.showBottom&&B.appendChild(b),/^#/.test(A.theme)){var x=lay.elem("style"),G=["#{{id}} .layui-laydate-header{background-color:{{theme}};}","#{{id}} .layui-this{background-color:{{theme}} !important;}"].join("").replace(/{{id}}/g,F.elemID).replace(/{{theme}}/g,A.theme);"styleSheet" in x?(x.setAttribute("type","text/css"),x.styleSheet.cssText=G):x.innerHTML=G,lay(B).addClass("laydate-theme-molv"),B.appendChild(x)}l.thisId=A.id,F.remove(y.thisElemDate),C?A.elem.append(B):(i.body.appendChild(B),F.position()),F.checkDate().calendar(null,0,"init"),F.changeEvent(),y.thisElemDate=F.elemID,"function"==typeof A.ready&&A.ready(lay.extend({},A.dateTime,{month:A.dateTime.month+1})),F.preview()},y.prototype.remove=function(k){var b=this,j=(b.config,lay("#"+(k||b.elemID)));return j[0]?(j.hasClass(d)||b.checkDate(function(){j.remove()}),b):b},y.prototype.position=function(){var j=this,b=j.config;return lay.position(j.bindElem||b.elem[0],j.elem,{position:b.position}),j},y.prototype.hint=function(k){var b=this,j=(b.config,lay.elem("div",{"class":f}));b.elem&&(j.innerHTML=k||"",lay(b.elem).find("."+f).remove(),b.elem.appendChild(j),clearTimeout(b.hinTimer),b.hinTimer=setTimeout(function(){lay(b.elem).find("."+f).remove()},3000))},y.prototype.getAsYM=function(k,b,j){return j?b--:b++,b<0&&(b=11,k--),b>11&&(b=0,k++),[k,b]},y.prototype.systemDate=function(j){var b=j||new Date;return{year:b.getFullYear(),month:b.getMonth(),date:b.getDate(),hours:j?j.getHours():0,minutes:j?j.getMinutes():0,seconds:j?j.getSeconds():0}},y.prototype.checkDate=function(F){var q,B,z=this,E=(new Date,z.config),C=z.lang(),H=E.dateTime=E.dateTime||z.systemDate(),k=z.bindElem||E.elem[0],A=(z.isInput(k)?"val":"html",function(){if(z.rangeElem){var I=[z.rangeElem[0].val(),z.rangeElem[1].val()];if(I[0]&&I[1]){return I.join(" "+z.rangeStr+" ")}}return z.isInput(k)?k.value:"static"===E.position?"":lay(k).attr("lay-date")}()),x=function(I){I.year>D[1]&&(I.year=D[1],B=!0),I.month>11&&(I.month=11,B=!0),I.hours>23&&(I.hours=0,B=!0),I.minutes>59&&(I.minutes=0,I.hours++,B=!0),I.seconds>59&&(I.seconds=0,I.minutes++,B=!0),q=l.getEndDate(I.month+1,I.year),I.date>q&&(I.date=q,B=!0)},b=function(K,L,I){var J=["startTime","endTime"];L=(L.match(z.EXP_SPLIT)||[]).slice(1),I=I||0,E.range&&(z[J[I]]=z[J[I]]||{}),lay.each(z.format,function(N,M){var O=parseFloat(L[N]);L[N].lengthG(E.max)||G(H)G(E.max))&&(z.endDate=lay.extend({},E.max)),F&&F(),z},y.prototype.mark=function(j,q){var b,x=this,k=x.config;return lay.each(k.mark,function(z,B){var A=z.split("-");A[0]!=q[0]&&0!=A[0]||A[1]!=q[1]&&0!=A[1]||A[2]!=q[2]||(b=B||q[2])}),b&&j.html(''+b+""),x},y.prototype.limit=function(b,B,q,C){var z,j=this,x=j.config,k={},A=x[q>41?"endDate":"dateTime"],E=lay.extend({},A,B||{});return lay.each({now:E,min:x.min,max:x.max},function(G,F){k[G]=j.newDate(lay.extend({year:F.year,month:F.month,date:F.date},function(){var H={};return lay.each(C,function(I,J){H[J]=F[J]}),H}())).getTime()}),z=k.nowk.max,b&&b[z?"addClass":"removeClass"](n),z},y.prototype.thisDateTime=function(k){var b=this,j=b.config;return k?b.endDate:j.dateTime},y.prototype.calendar=function(B,q,j){var z,F,E,H=this,k=H.config,q=q?1:0,x=B||H.thisDateTime(q),A=new Date,I=H.lang(),C="date"!==k.type&&"datetime"!==k.type,G=lay(H.table[q]).find("td"),b=lay(H.elemHeader[q][2]).find("span");return x.yearD[1]&&(x.year=D[1],H.hint(I.invalidDate)),H.firstDate||(H.firstDate=lay.extend({},x)),A.setFullYear(x.year,x.month,1),z=A.getDay(),F=l.getEndDate(x.month||12,x.year),E=l.getEndDate(x.month+1,x.year),lay.each(G,function(L,M){var K=[x.year,x.month],J=0;M=lay(M),M.removeAttr("class"),L=z&&L=S.firstDate.year&&(T.month=G.max.month,T.date=G.max.date),S.limit(lay(V),T,z),A++}),lay(E[M?0:1]).attr("lay-ym",A-8+"-"+B[1]).html(C+O+" - "+(A-1+O))}else{if("month"===K){lay.each(new Array(12),function(V){var T=lay.elem("li",{"lay-ym":V}),U={year:B[0],month:V};V+1==B[1]&&lay(T).addClass(c),T.innerHTML=N.month[V]+(M?"\u6708":""),Q.appendChild(T),B[0]=S.firstDate.year&&(U.date=G.max.date),S.limit(lay(T),U,z)}),lay(E[M?0:1]).attr("lay-ym",B[0]+"-"+B[1]).html(B[0]+O)}else{if("time"===K){var k=function(){lay(Q).find("ol").each(function(T,U){lay(U).find("li").each(function(W,V){S.limit(lay(V),[{hours:W},{hours:S[H].hours,minutes:W},{hours:S[H].hours,minutes:S[H].minutes,seconds:W}][T],z,[["hours"],["hours","minutes"],["hours","minutes","seconds"]][T])})}),G.range||S.limit(lay(S.footer).find(s),S[H],0,["hours","minutes","seconds"])};G.range?S[H]||(S[H]="startTime"===H?j:S.endDate):S[H]=j,lay.each([24,60,60],function(T,V){var W=lay.elem("li"),U=[""+N.time[T]+"
"];lay.each(new Array(V),function(X){U.push("- "+lay.digit(X,2)+"
")}),W.innerHTML=U.join("")+"
",Q.appendChild(W)}),k()}}}if(L&&J.removeChild(L),J.appendChild(Q),"year"===K||"month"===K){lay(S.elemMain[z]).addClass("laydate-ym-show"),lay(Q).find("li").on("click",function(){var T=0|lay(this).attr("lay-ym");if(!lay(this).hasClass(n)){0===z?(j[K]=T,S.limit(lay(S.footer).find(s),null,0)):S.endDate[K]=T;var U="year"===G.type||"month"===G.type;U?(lay(Q).find("."+c).removeClass(c),lay(this).addClass(c),"month"===G.type&&"year"===K&&(S.listYM[z][0]=T,b&&((z?S.endDate:j).year=T),S.list("month",z))):(S.checkDate("limit").calendar(null,z),S.closeList()),S.setBtnStatus(),G.range||("month"===G.type&&"month"===K||"year"===G.type&&"year"===K)&&S.setValue(S.parse()).remove().done(),S.done(null,"change"),lay(S.footer).find("."+u).removeClass(n)}})}else{var F=lay.elem("span",{"class":g}),I=function(){lay(Q).find("ol").each(function(T){var U=this,V=lay(U).find("li");U.scrollTop=30*(S[H][q[T]]-2),U.scrollTop<=0&&V.each(function(W,X){if(!lay(this).hasClass(n)){return U.scrollTop=30*(W-2),!0}})})},P=lay(x[2]).find("."+g);I(),F.innerHTML=G.range?[N.startTime,N.endTime][z]:N.timeTips,lay(S.elemMain[z]).addClass("laydate-time-show"),P[0]&&P.remove(),x[2].appendChild(F),lay(Q).find("ol").each(function(U){var T=this;lay(T).find("li").on("click",function(){var V=0|this.innerHTML;lay(this).hasClass(n)||(G.range?S[H][q[U]]=V:j[q[U]]=V,lay(T).find("."+c).removeClass(c),lay(this).addClass(c),k(),I(),(S.endDate||"time"===G.type)&&S.done(null,"change"),S.setBtnStatus())})})}return S},y.prototype.listYM=[],y.prototype.closeList=function(){var b=this;b.config;lay.each(b.elemCont,function(k,j){lay(this).find("."+o).remove(),lay(b.elemMain[k]).removeClass("laydate-ym-show laydate-time-show")}),lay(b.elem).find("."+g).remove()},y.prototype.setBtnStatus=function(b,q,k){var A,j=this,x=j.config,z=j.lang(),B=lay(j.footer).find(s);x.range&&"time"!==x.type&&(q=q||x.dateTime,k=k||j.endDate,A=j.newDate(q).getTime()>j.newDate(k).getTime(),j.limit(null,q)||j.limit(null,k)?B.addClass(n):B[A?"addClass":"removeClass"](n),b&&A&&j.hint("string"==typeof b?z.timeout.replace(/\u65e5\u671f/g,b):z.timeout))},y.prototype.parse=function(k,x){var b=this,z=b.config,q=x||("end"==k?lay.extend({},b.endDate,b.endTime):z.range?lay.extend({},z.dateTime,b.startTime):z.dateTime),j=l.parse(q,b.format,1);return z.range&&void 0===k?j+" "+b.rangeStr+" "+b.parse("end"):j},y.prototype.newDate=function(b){return b=b||{},new Date(b.year||1,b.month||0,b.date||1,b.hours||0,b.minutes||0,b.seconds||0)},y.prototype.setValue=function(j){var k=this,b=k.config,q=k.bindElem||b.elem[0];return"static"===b.position?k:(j=j||"",k.isInput(q)?lay(q).val(j):k.rangeElem?(k.rangeElem[0].val(j?k.parse("start"):""),k.rangeElem[1].val(j?k.parse("end"):"")):(0===lay(q).find("*").length&&lay(q).html(j),lay(q).attr("lay-date",j)),k)},y.prototype.preview=function(){var j=this,k=j.config;if(k.isPreview){var b=lay(j.elem).find("."+R),q=k.range?j.endDate?j.parse():"":j.parse();b.html(q).css({color:"#5FB878","font-size":"14px;"}),setTimeout(function(){b.css({color:"#666","font-size":"12px;"})},300)}},y.prototype.done=function(j,q){var b=this,z=b.config,k=lay.extend({},lay.extend(z.dateTime,b.startTime)),x=lay.extend({},lay.extend(b.endDate,b.endTime));return lay.each([k,x],function(B,A){"month" in A&&lay.extend(A,{month:A.month+1})}),b.preview(),j=j||[b.parse(),k,x],"function"==typeof z[q||"done"]&&z[q||"done"].apply(z,j),b},y.prototype.choose=function(j,q){var b=this,z=b.config,k=b.thisDateTime(q),x=(lay(b.elem).find("td"),j.attr("lay-ymd").split("-"));x={year:0|x[0],month:(0|x[1])-1,date:0|x[2]},j.hasClass(n)||(lay.extend(k,x),z.range?(lay.each(["startTime","endTime"],function(B,A){b[A]=b[A]||{hours:0,minutes:0,seconds:0}}),b.calendar(null,q).done(null,"change")):"static"===z.position?b.calendar().done().done(null,"change"):"date"===z.type?b.setValue(b.parse()).remove().done():"datetime"===z.type&&b.calendar().done(null,"change"))},y.prototype.tool=function(b,q){var k=this,A=k.config,j=k.lang(),x=A.dateTime,z="static"===A.position,B={datetime:function(){lay(b).hasClass(n)||(k.list("time",0),A.range&&k.list("time",1),lay(b).attr("lay-type","date").html(k.lang().dateTips))},date:function(){k.closeList(),lay(b).attr("lay-type","datetime").html(k.lang().timeTips)},clear:function(){z&&(lay.extend(x,k.firstDate),k.calendar()),A.range&&(delete A.dateTime,delete k.endDate,delete k.startTime,delete k.endTime),k.setValue("").remove(),k.done(["",{},{}])},now:function(){var C=new Date;lay.extend(x,k.systemDate(),{hours:C.getHours(),minutes:C.getMinutes(),seconds:C.getSeconds()}),k.setValue(k.parse()).remove(),z&&k.calendar(),k.done()},confirm:function(){if(A.range){if(lay(b).hasClass(n)){return k.hint("time"===A.type?j.timeout.replace(/\u65e5\u671f/g,"\u65f6\u95f4"):j.timeout)}}else{if(lay(b).hasClass(n)){return k.hint(j.invalidDate)}}k.done(),k.setValue(k.parse()).remove()}};B[q]&&B[q]()},y.prototype.change=function(b){var q=this,k=q.config,A=q.thisDateTime(b),j=k.range&&("year"===k.type||"month"===k.type),x=q.elemCont[b||0],z=q.listYM[b],B=function(C){var F=lay(x).find(".laydate-year-list")[0],E=lay(x).find(".laydate-month-list")[0];return F&&(z[0]=C?z[0]-15:z[0]+15,q.list("year",b)),E&&(C?z[0]--:z[0]++,q.list("month",b)),(F||E)&&(lay.extend(A,{year:z[0]}),j&&(A.year=z[0]),k.range||q.done(null,"change"),k.range||q.limit(lay(q.footer).find(s),{year:z[0]})),q.setBtnStatus(),F||E};return{prevYear:function(){B("sub")||(A.year--,q.checkDate("limit").calendar(null,b),q.done(null,"change"))},prevMonth:function(){var C=q.getAsYM(A.year,A.month,"sub");lay.extend(A,{year:C[0],month:C[1]}),q.checkDate("limit").calendar(null,b),q.done(null,"change")},nextMonth:function(){var C=q.getAsYM(A.year,A.month);lay.extend(A,{year:C[0],month:C[1]}),q.checkDate("limit").calendar(null,b),q.done(null,"change")},nextYear:function(){B()||(A.year++,q.checkDate("limit").calendar(null,b),q.done(null,"change"))}}},y.prototype.changeEvent=function(){var b=this;b.config;lay(b.elem).on("click",function(j){lay.stope(j)}).on("mousedown",function(j){lay.stope(j)}),lay.each(b.elemHeader,function(k,j){lay(j[0]).on("click",function(q){b.change(k).prevYear()}),lay(j[1]).on("click",function(q){b.change(k).prevMonth()}),lay(j[2]).find("span").on("click",function(q){var A=lay(this),x=A.attr("lay-ym"),z=A.attr("lay-type");x&&(x=x.split("-"),b.listYM[k]=[0|x[0],0|x[1]],b.list(z,k),lay(b.footer).find("."+u).addClass(n))}),lay(j[3]).on("click",function(q){b.change(k).nextMonth()}),lay(j[4]).on("click",function(q){b.change(k).nextYear()})}),lay.each(b.table,function(k,j){var q=lay(j).find("td");q.on("click",function(){b.choose(lay(this),k)})}),lay(b.footer).find("span").on("click",function(){var j=lay(this).attr("lay-type");b.tool(this,j)})},y.prototype.isInput=function(b){return/input|textarea/.test(b.tagName.toLocaleLowerCase())},y.prototype.events=function(){var k=this,b=k.config,j=function(q,x){q.on(b.trigger,function(){x&&(k.bindElem=this),k.render()})};b.elem[0]&&!b.elem[0].eventHandler&&(j(b.elem,"bind"),j(b.eventElem),b.elem[0].eventHandler=!0)},r.that={},r.getThis=function(j){var b=r.that[j];return b||hint.error(j?m+" instance with ID '"+j+"' not found":"ID argument required"),b},a.run=function(b){b(i).on("mousedown",function(j){if(l.thisId){var k=r.getThis(l.thisId);if(k){var q=k.config;j.target!==q.elem[0]&&j.target!==q.eventElem[0]&&j.target!==b(q.closeStop)[0]&&k.remove()}}}).on("keydown",function(j){if(l.thisId){var k=r.getThis(l.thisId);k&&13===j.keyCode&&b("#"+k.elemID)[0]&&k.elemID===y.thisElemDate&&(j.preventDefault(),b(k.footer).find(s)[0].click())}}),b(e).on("resize",function(){if(l.thisId){var j=r.getThis(l.thisId);if(j){return !(!j.elem||!b(v)[0])&&void j.position()}}})},l.render=function(j){var b=new y(j);return r.call(b)},l.parse=function(k,b,j){return k=k||{},"string"==typeof b&&(b=r.formatArr(b)),b=(b||[]).concat(),lay.each(b,function(x,q){/yyyy|y/.test(q)?b[x]=lay.digit(k.year,q.length):/MM|M/.test(q)?b[x]=lay.digit(k.month+(j||0),q.length):/dd|d/.test(q)?b[x]=lay.digit(k.date,q.length):/HH|H/.test(q)?b[x]=lay.digit(k.hours,q.length):/mm|m/.test(q)?b[x]=lay.digit(k.minutes,q.length):/ss|s/.test(q)&&(b[x]=lay.digit(k.seconds,q.length))}),b.join("")},l.getEndDate=function(k,b){var j=new Date;return j.setFullYear(b||j.getFullYear(),k||j.getMonth()+1,1),new Date(j.getTime()-86400000).getDate()},p?(l.ready(),layui.define("lay",function(b){l.path=layui.cache.dir,a.run(lay),b(m,l)})):"function"==typeof define&&define.amd?define(function(){return a.run(lay),l}):function(){l.ready(),a.run(e.lay),e.laydate=l}()}(window,window.document);