var Sunday = "星期日"; var Monday = "星期一"; var Tuesday = "星期二"; var Wednesday = "星期三"; var Thursday = "星期四"; var Friday = "星期五"; var Saturday = "星期六"; var Sun = "日"; var Mon = "一"; var Tue = "二"; var Wed = "三"; var Thu = "四"; var Fri = "五"; var Sat = "六"; var January = "一月"; var February = "二月"; var March = "三月"; var April = "四月"; var May = "五月"; var June = "六月"; var July = "七月"; var Aguest = "八月"; var September = "九月"; var October = "十月"; var November = "十一月"; var December = "十二月"; var Jan = "一月"; var Feb = "二月"; var Mar = "三月"; var Apr = "四月"; var Jun = "六月"; var Jul = "七月"; var Agu = "八月"; var Sep = "九月"; var Oct = "十月"; var Nov = "十一月"; var Dec = "十二月"; var calendar_help = "帮助"; var calendar_about1 = "选择日期:\r\n- 点击 \xab, \xbb 按钮选择年份\r\n- 点击 "; var calendar_about2 = " 按钮选择月份\r\n- 长按以上按钮可从菜单中快速选择年份或月份"; var calendar_about_time = "\r\n\r\n选择时间:\r\n- 点击小时或分钟可使改数值加一\r\n- 按住Shift键点击小时或分钟可使改数值减一\r\n- 点击拖动鼠标可进行快速选择"; var prev_year = "上一年 (按住出菜单)"; var prev_month = "上一月 (按住出菜单)"; var go_today = "转到今日"; var next_month = "下一月 (按住出菜单)"; var next_year = "下一年 (按住出菜单)"; var sel_date = "选择日期"; var drag_to_move = "拖动"; var part_today = "(今日)"; var day_first = "最左边显示"; var calendar_close = "关闭"; var calendar_today = "今日"; var time_part = "(Shift-)点击鼠标或拖动改变值"; var calendar_wk = "周"; var calendar_day = "日"; var calendar_time = "时间"; !function(t){"function"==typeof define?define("xvDate",[],function(e,s,i){var a={};t(a),i.exports=a.xvDate}):t(window)}(function(t){var e={};t.xvDate=function(t){var s=t.triggerId||t.targetId;if("object"==typeof s&&s.length)for(var i=[],a=0;a
"+this.viewTb()+"
",a.handleTime(),a.gb.datesHms=e.getId("dates_hms"),a.setPosition(a.gb.algin,a.gb.datesBox,{left:0,top:0}),a.setPosition(a.gb.algin,a.gb.datesBox),s={that:a},e.addEvent(document,"click",a.docArea,s)}var d=this.gb.datesHms;d?this.shde(d,2):this.shde(d,1);var m=i.triggerId||i.targetId;if("object"==typeof m&&m.length){a.gb.trigger=[];for(var l=0;l170&&(e.yyList.scrollTop=a)}}}else e.yyList.style.display="none"},ymLst:function(t){var e=t.srcElement||t.target,s=t.datas.els,i=t.datas.that;i.contain(s.yearWrap,e)||i.ishd(s.yyList)||(s.yyList.style.display="none"),i.contain(s.monthWrap,e)||i.ishd(s.mmList)||(s.mmList.style.display="none")},focusStatus:function(){this.focus&&(this.select(),this.className="")},combineTime:function(t,e){var s;if(!t)return!1;var i=t.year.toString(),a=this.formatTime(t.month.toString()),n=this.formatTime(t.date.toString()),r=this.formatTime(t.hours.toString()),o=this.formatTime(t.minutes.toString()),d=this.formatTime(t.seconds.toString());switch(e){case"hms":s=i+a+n+r+o+d;break;case"ymd":s=i+a+n;break;case"ym":s=i+a;break;case"y":s=i;break;default:s=i+a+n}return parseInt(s,10)},compareTime:function(t,e,s,i){var a=this,n=a.gb.time,r=a.combineTime({year:t,month:e,date:s,hours:n.hours,minutes:n.seconds,seconds:n.minutes},i),o=a.combineTime(a.gb.minTime,i)||"",d=a.combineTime(a.gb.maxTime,i)||"";return o&&!d?!(o>r)||null:!o&&d?!(r>d)||null:!(o&&d&&(r>d||o>r))||null},initTimes:function(t){var e,s,i,a,n,r,o,d,m=this.gb.target,l=this.checkTime(m.value);l&&(l=this.datesSplit(l)),t?(d=new Date,e=d.getDate(),s=d.getFullYear(),i=d.getMonth()+1,a=d.getHours(),n=d.getMinutes(),r=d.getSeconds()):!t&&l?(e=l.date,s=l.year,i=l.month,a=l.hours,n=l.minutes,r=l.seconds):t||this.gb.minTime||this.gb.maxTime||l?l||!this.gb.minTime&&!this.gb.maxTime||(o=this.gb.minTime||this.gb.maxTime,e=o.date,s=o.year,i=o.month,a=o.hours,n=o.minutes,r=o.seconds):(d=new Date,e=d.getDate(),s=d.getFullYear(),i=d.getMonth()+1,a=0,n=0,r=0),this.gb.time={year:s,month:i,date:e,hours:a,minutes:n,seconds:r},this.insertDate()},viewTb:function(){var t=["日","一","二","三","四","五","六"],e=[],s=0,i=this.creatEle("table"),a=this.creatEle("thead"),n=this.creatEle("tbody");i.className="dates_table",i.id="dates_table";for(var r=1;8>r;r++){var o=this.creatEle("th");this.append(o,a),o.innerHTML=t[r-1]}for(r=1;7>r;r++){e[r]=this.creatEle("tr"),this.append(e[r],n);for(var d=1;8>d;d++){var m=this.creatEle("td");m.setAttribute("index",s++),this.append(m,e[r])}}return this.append(a,i),this.append(n,i),i.outerHTML},insertDate:function(){var t,e,s=this.gb.els,i=this.gb.time,a=s.yyConList,n=s.mmConList,r=s.iptYear,o=s.iptMonth,d=s.iptHours,m=s.iptMinutes,l=s.iptSeconds,c=i.year,g=parseInt(i.month,10),h=i.date,u=i.hours,b=i.minutes,y=i.seconds,v=this.gb.td,p=new Date;p.setFullYear(c,g-1),p.setDate(1);var f=p.getDay(),_=this.getDays(c,g-1);this.dateStatus(n,g,"current"),this.dateStatus(a,c,"current");for(var x=0;_>x;x++)v[f+x].innerHTML=x+1,v[f+x].className="",x+1===h?v[f+x].className="current_day":h>_&&(v[f+_-1].className="current_day",this.gb.time.date=_),v[f+x].setAttribute("m",g),v[f+x].setAttribute("y",c);for(x=0;f>x;x++)v[f-x-1].className="other_day",v[f-x-1].innerHTML=this.getDays(c,g-2)-x,g-1>0?(t=g-1,e=c):(t=12,e=c-1),v[f-x-1].setAttribute("m",t),v[f-x-1].setAttribute("y",e);for(x=0;x12?(t=1,e=c+1):(t=g+1,e=c),v[f+_+x].setAttribute("m",t),v[f+_+x].setAttribute("y",e);var T=this.combineTime(this.gb.minTime)||"",E=this.combineTime(this.gb.maxTime)||"",I={year:c,month:g,date:h,hours:this.gb.time.hours,minutes:this.gb.time.minutes,seconds:y};if(T){for(x=0;xE&&(v[x].className="disable_day");for(x=0;xthis.gb.maxTime.year&&(a[x].className="disable_day");for(x=0;xthis.combineTime(this.gb.maxTime,"ym")&&(n[x].className="disable_day")}r.value=c,o.value=this.formatTime(g),d.value=this.formatTime(u),m.value=this.formatTime(b),l.value=this.formatTime(y)},ymClick:function(t,e,s){function i(){"month"===s?(n=this.getAttribute("dateValue"),a=o.gb.time.year,r=o.gb.time.date):"year"===s&&(a=this.getAttribute("dateValue"),n=o.gb.time.month,r=o.gb.time.date),o.compareTime(a,n,r)&&(o.gb.time.year=a,o.gb.time.month=n,o.gb.time.date=r,o.removeStatus(t),this.className="current",e.style.display="none",o.insertDate())}for(var a,n,r,o=this,d=0;dd?(i=12,s=a+d):12===n&&d>0?(i=1,s=a+1):i=n+d;var m=e.getDays(s,i-1);r>m&&(r=m)}else"year"===o&&(s=a+d);e.gb.time.year=s,e.gb.time.month=i,e.gb.time.date=r,e.insertDate()},removeStatus:function(t){for(var e=0;ee?(e=11,t-=1):e>11&&(e=0,t+=1),e+1===2&&(s=t%4==0&&t%100!=0||t%400==0?29:28),[31,s,31,30,31,30,31,31,30,31,30,31][e]},creatEle:function(t,e){return(e||document).createElement(t)},append:function(t,e){return(e||document.body).appendChild(t)},setPosition:function(t,e,s){if(s&&"object"==typeof s)return e.style.left=0,e.style.top=0,!1;var i=this.getOffset(t),a=i.left,n=i.top,r=e.offsetHeight,o=t.offsetHeight,d=this.resetSizeAttr("scrollTop"),m=this.resetSizeAttr("offsetHeight"),l=n-d;e.style.top=m-l>r?n+o-1+"px":n-r+1+"px",e.style.left=a+"px"},resetSizeAttr:function(t,e){return(e||document.body)[t]||document.documentElement&&document.documentElement[t]},getOffset:function(t,e){var s=e||{left:0,top:0};return t&&(s.left+=t.offsetLeft,s.top+=t.offsetTop,t.offsetParent&&(t=t.offsetParent,arguments.callee(t,s))),s},contain:function(t,e){return document.all?t.contains(e):20===t.compareDocumentPosition(e)||t===e||null}},e.enable=function(s,i,a){e.addEvent(s,"click",function(){t.xvDate.Dates?t.xvDate.Dates.init(a,i):t.xvDate.Dates=new e.fn.init(a,i)})},e.getId=function(t,e){return(e||document).getElementById(t)},e.addEvent=function(t,e,s,i){t["evt"+e+s]=t["evt"+e+s]||null,t["evt"+e+s]||(t["evt"+e+s]=function(e){e=e||window.event,e.datas=i||{},s.call(t,e)}),t.addEventListener?t.addEventListener(e,t["evt"+e+s],!1):t.attachEvent&&t.attachEvent("on"+e,t["evt"+e+s])},e.removeEvent=function(t,e,s){void 0!==t.removeEventListener?t.removeEventListener(e,t["evt"+e+s],!1):void 0!==t.detachEvent&&s&&t["evt"+e+s]&&t.detachEvent("on"+e,t["evt"+e+s])},e.fn.init.prototype=e.fn});