All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.web.lib.calendar.calendar.min.js Maven / Gradle / Ivy

There is a newer version: 6.2.04
Show newest version
!function(a){"function"==typeof define?define("xvDate",[],function(b,c,d){var e={};a(e),d.exports=e.xvDate}):a(window)}(function(a){var b={};a.xvDate=function(a){var c=a.triggerId||a.targetId;if("object"==typeof c&&c.length)for(var d=[],e=0;e
"+this.viewTb()+"
",e.handleTime(),e.gb.datesHms=b.getId("dates_hms"),e.setPosition(e.gb.algin,e.gb.datesBox,{left:0,top:0}),e.setPosition(e.gb.algin,e.gb.datesBox),c={that:e},b.addEvent(document,"click",e.docArea,c)}var i=this.gb.datesHms;i?this.shde(i,2):this.shde(i,1);var j=d.triggerId||d.targetId;if("object"==typeof j&&j.length){e.gb.trigger=[];for(var k=0;k170&&(b.yyList.scrollTop=e)}}}else b.yyList.style.display="none"},ymLst:function(a){var b=a.srcElement||a.target,c=a.datas.els,d=a.datas.that;d.contain(c.yearWrap,b)||d.ishd(c.yyList)||(c.yyList.style.display="none"),d.contain(c.monthWrap,b)||d.ishd(c.mmList)||(c.mmList.style.display="none")},focusStatus:function(){this.focus&&(this.select(),this.className="")},combineTime:function(a,b){var c;if(!a)return!1;var d=a.year.toString(),e=this.formatTime(a.month.toString()),f=this.formatTime(a.date.toString()),g=this.formatTime(a.hours.toString()),h=this.formatTime(a.minutes.toString()),i=this.formatTime(a.seconds.toString());switch(b){case"hms":c=d+e+f+g+h+i;break;case"ymd":c=d+e+f;break;case"ym":c=d+e;break;case"y":c=d;break;default:c=d+e+f}return parseInt(c,10)},compareTime:function(a,b,c,d){var e=this,f=e.gb.time,g=e.combineTime({year:a,month:b,date:c,hours:f.hours,minutes:f.seconds,seconds:f.minutes},d),h=e.combineTime(e.gb.minTime,d)||"",i=e.combineTime(e.gb.maxTime,d)||"";return h&&!i?!(gi)||null:!h||!i||(!(g>i||gu&&(r[t+u-1].className="current_day",this.gb.time.date=u),r[t+v].setAttribute("m",m),r[t+v].setAttribute("y",l);for(v=0;v0?(a=m-1,b=l):(a=12,b=l-1),r[t-v-1].setAttribute("m",a),r[t-v-1].setAttribute("y",b);for(v=0;v12?(a=1,b=l+1):(a=m+1,b=l),r[t+u+v].setAttribute("m",a),r[t+u+v].setAttribute("y",b);var w=this.combineTime(this.gb.minTime)||"",x=this.combineTime(this.gb.maxTime)||"",y={year:l,month:m,date:n,hours:this.gb.time.hours,minutes:this.gb.time.minutes,seconds:q};if(w){for(v=0;vx&&(r[v].className="disable_day");for(v=0;vthis.gb.maxTime.year&&(e[v].className="disable_day");for(v=0;vthis.combineTime(this.gb.maxTime,"ym")&&(f[v].className="disable_day")}g.value=l,h.value=this.formatTime(m),i.value=this.formatTime(o),j.value=this.formatTime(p),k.value=this.formatTime(q)},ymClick:function(a,b,c){function d(){"month"===c?(f=this.getAttribute("dateValue"),e=h.gb.time.year,g=h.gb.time.date):"year"===c&&(e=this.getAttribute("dateValue"),f=h.gb.time.month,g=h.gb.time.date),h.compareTime(e,f,g)&&(h.gb.time.year=e,h.gb.time.month=f,h.gb.time.date=g,h.removeStatus(a),this.className="current",b.style.display="none",h.insertDate())}for(var e,f,g,h=this,i=0;i0?(d=1,c=e+1):d=f+i;var j=b.getDays(c,d-1);g>j&&(g=j)}else"year"===h&&(c=e+i);b.gb.time.year=c,b.gb.time.month=d,b.gb.time.date=g,b.insertDate()},removeStatus:function(a){for(var b=0;b11&&(b=0,a+=1),b+1===2&&(c=a%4==0&&a%100!=0||a%400==0?29:28),[31,c,31,30,31,30,31,31,30,31,30,31][b]},creatEle:function(a,b){return(b||document).createElement(a)},append:function(a,b){return(b||document.body).appendChild(a)},setPosition:function(a,b,c){if(c&&"object"==typeof c)return b.style.left=0,b.style.top=0,!1;var d=this.getOffset(a),e=d.left,f=d.top,g=b.offsetHeight,h=a.offsetHeight,i=this.resetSizeAttr("scrollTop"),j=this.resetSizeAttr("offsetHeight"),k=f-i;b.style.top=j-k>g?f+h-1+"px":f-g+1+"px",b.style.left=e+"px"},resetSizeAttr:function(a,b){return(b||document.body)[a]||document.documentElement&&document.documentElement[a]},getOffset:function(a,b){var c=b||{left:0,top:0};return a&&(c.left+=a.offsetLeft,c.top+=a.offsetTop,a.offsetParent&&(a=a.offsetParent,arguments.callee(a,c))),c},contain:function(a,b){return document.all?a.contains(b):20===a.compareDocumentPosition(b)||a===b||null}},b.enable=function(c,d,e){b.addEvent(c,"click",function(){a.xvDate.Dates?a.xvDate.Dates.init(e,d):a.xvDate.Dates=new b.fn.init(e,d)})},b.getId=function(a,b){return(b||document).getElementById(a)},b.addEvent=function(a,b,c,d){a["evt"+b+c]=a["evt"+b+c]||null,a["evt"+b+c]||(a["evt"+b+c]=function(b){b=b||window.event,b.datas=d||{},c.call(a,b)}),a.addEventListener?a.addEventListener(b,a["evt"+b+c],!1):a.attachEvent&&a.attachEvent("on"+b,a["evt"+b+c])},b.removeEvent=function(a,b,c){void 0!==a.removeEventListener?a.removeEventListener(b,a["evt"+b+c],!1):void 0!==a.detachEvent&&c&&a["evt"+b+c]&&a.detachEvent("on"+b,a["evt"+b+c])},b.fn.init.prototype=b.fn});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy