-
Notifications
You must be signed in to change notification settings - Fork 1
/
ext.ux.datepickerplus-min.js
11 lines (10 loc) · 42.2 KB
/
ext.ux.datepickerplus-min.js
1
2
3
4
5
6
7
8
9
10
11
/*
* Ext.ux.DatePickerPlus Addon
* Ext.ux.form.DateFieldPlus Addon
*
* V 1.4.6
*
* @author Marco Wienkoop (wm003/lubber)
* @copyright (c) 2008-2018, Marco Wienkoop (marco.wienkoop@lubber.de) http://www.lubber.de
*/
Date.prototype.getFirstDateOfWeek=function(e){void 0===e&&(e=Ext.DatePicker?Ext.DatePicker.prototype.startDay:0);var t=this.getDay()-e;return t<0&&(t+=7),this.add(Date.DAY,-t)},Array.prototype.sortDates=function(){return this.sort(function(e,t){return e.getTime()-t.getTime()})},Ext.util.EasterDate||(Ext.util.EasterDate=function(e,t){void 0===e&&(e=(new Date).getFullYear()),e=parseInt(e,10),void 0===t&&(t=0),t=parseInt(t,10);var s=e%19,i=(19*s+24)%30,a=i+(e%4*2+e%7*4+6*i+5)%7;(35==a||34==a&&28==i&&s>10)&&(a-=7);var l=new Date(e,2,22);return l.setTime(l.getTime()+864e5*a+864e5*t),l}),Ext.namespace("Ext.ux","Ext.ux.form"),Ext.ux.DatePickerPlus=Ext.extend(Ext.DatePicker,{version:"1.4.6",noOfMonth:1,noOfMonthPerRow:3,fillupRows:!0,eventDates:function(e){return[]},styleDisabledDates:!1,eventDatesSelectable:!0,defaultEventDatesText:"",defaultEventDatesCls:"x-datepickerplus-eventdates",clickRepeaterConfig:{},setEventDates:function(e,t){void 0===t&&(t=!0),this.edArray=[];for(var s=0,i=e.length;s<i;++s)Ext.isDate(e[s])?this.edArray.push({date:e[s],text:this.defaultEventDatesText,cls:this.defaultEventDatesCls}):e[s].date&&(e[s].date=this.jsonDate(e[s].date),this.edArray.push(e[s]));this.eventDates=function(e){return this.edArray},this.rendered&&t&&(this.eventDatesNumbered=this.convertCSSDatesToNumbers(this.eventDates(this.activeDate.getFullYear())),this.update(this.activeDate))},eventDatesRE:!1,eventDatesRECls:"",eventDatesREText:"",showWeekNumber:!0,weekName:"Wk.",selectWeekText:"Click to select all days of this week",selectMonthText:"Click to select all weeks of this month",multiSelection:!1,multiSelectByCTRL:!0,selectedDates:[],prevNextDaysView:"mark",preSelectedDates:[],lastSelectedDate:!1,markNationalHolidays:!0,nationalHolidaysCls:"x-datepickerplus-nationalholidays",nationalHolidays:function(e){e=void 0===e?this.lastRenderedYear?this.lastRenderedYear:(new Date).getFullYear():parseInt(e,10);var t=new Date(e,0,1).getDay(),s=new Date(e,1,1).getDay(),i=new Date(e,4,1).getDay(),a=new Date(e,8,1).getDay(),l=new Date(e,9,1).getDay(),r=new Date(e,10,1).getDay();return[{text:"New Year's Day",date:new Date(e,0,1)},{text:"Martin Luther King Day",date:new Date(e,0,t>1?23-t:16-t)},{text:"Washington's Birthday",date:new Date(e,1,s>1?23-s:16-s)},{text:"Memorial Day",date:new Date(e,4,6==i?31:30-i)},{text:"Independence Day",date:new Date(e,6,4)},{text:"Labor Day",date:new Date(e,8,a>1?9-a:2-a)},{text:"Columbus Day",date:new Date(e,9,l>1?16-l:9-l)},{text:"Veterans Day",date:new Date(e,10,11)},{text:"Thanksgiving Day",date:new Date(e,10,r>4?33-r:26-r)},{text:"Christmas Day",date:new Date(e,11,25)}]},markWeekends:!0,weekendCls:"x-datepickerplus-weekends",weekendText:"",weekendDays:[6,0],useQuickTips:!0,pageKeyWarp:1,maxSelectionDays:!1,maxSelectionDaysTitle:"Datepicker",maxSelectionDaysText:"You can only select a maximum amount of %0 days",undoText:"Undo",stayInAllowedRange:!0,summarizeHeader:!1,resizable:!1,renderOkUndoButtons:!0,renderTodayButton:!0,disablePartialUnselect:!0,allowedDates:!1,allowedDatesText:"",strictRangeSelect:!1,displayMask:3,displayMaskText:"Please wait...",renderPrevNextButtons:!0,renderPrevNextYearButtons:!1,disableMonthPicker:!1,nextYearText:"Next Year (Control+Up)",prevYearText:"Previous Year (Control+Down)",showActiveDate:!1,shiftSpaceSelect:!0,disabledLetter:!1,allowMouseWheel:!0,focus:Ext.emptyFn,initComponent:function(){Ext.ux.DatePickerPlus.superclass.initComponent.call(this),this.noOfMonthPerRow=this.noOfMonthPerRow>this.noOfMonth?this.noOfMonth:this.noOfMonthPerRow,this.addEvents("beforeyearchange","afteryearchange","beforemonthchange","aftermonthchange","beforemonthclick","beforeweekclick","beforedateclick","aftermonthclick","afterweekclick","afterdateclick","undo","beforemousewheel","beforemaxdays")},activeDateKeyNav:function(e){if(this.showActiveDate){this.activeDate=this.activeDate.add("d",e);var t=this.activeDateCell.split("#"),s=parseInt(t[0],10),i=parseInt(t[1],10),a=Ext.get(this.cellsArray[s].elements[i]);i+e>41&&s+1>=this.cellsArray.length||i+e<0&&s-1<0?this.update(this.activeDate):(a.removeClass("x-datepickerplus-activedate"),(i+=e)>41?(i-=42,s++):i<0&&(i+=42,s--),(a=Ext.get(this.cellsArray[s].elements[i])).addClass("x-datepickerplus-activedate"),this.activeDateCell=s+"#"+i)}},handleMouseWheel:function(e){if(!1!==this.fireEvent("beforemousewheel",this,e)){var t=this.activeDate?this.activeDate.getMonth():99,s=this.activeDate?this.activeDate.getFullYear():0;Ext.ux.DatePickerPlus.superclass.handleMouseWheel.call(this,e);var i=this.activeDate?this.activeDate.getMonth():999,a=this.activeDate?this.activeDate.getFullYear():9999;t!=i&&this.fireEvent("aftermonthchange",this,t,i),s!=a&&this.fireEvent("afteryearchange",this,s,a)}},doDisabled:function(e){this.keyNav.setDisabled(e),this.renderPrevNextButtons&&(this.leftClickRpt.setDisabled(e),this.rightClickRpt.setDisabled(e)),this.renderPrevNextYearButtons&&(this.leftYearClickRpt.setDisabled(e),this.rightYearClickRpt.setDisabled(e)),this.todayBtn&&(this.todayKeyListener.setDisabled(e),this.todayBtn.setDisabled(e))},onRender:function(e,t){0===this.noOfMonthPerRow&&(this.noOfMonthPerRow=1),this.fillupRows&&this.noOfMonthPerRow>1&&this.noOfMonth%this.noOfMonthPerRow!=0&&(this.noOfMonth+=this.noOfMonthPerRow-this.noOfMonth%this.noOfMonthPerRow);var s=Ext.isIE?" x-datepickerplus-ie":"",i=['<table cellspacing="0"',this.multiSelection?' class="x-date-multiselect'+s+'" ':""!==s?'class="'+s+'" ':"",">"];i.push("<tr>");var a=Ext.isIE?'<img src="'+Ext.BLANK_IMAGE_URL+'" />':"",l=this.multiSelection?this.useQuickTips?' ext:qtip="'+this.selectWeekText+'" ':' title="'+this.selectWeekText+'" ':"",r=this.markWeekends&&""!==this.weekendText?this.useQuickTips?' ext:qtip="'+this.weekendText+'" ':' title="'+this.weekendText+'" ':"",h=["<thead><tr>"];this.showWeekNumber&&h.push('<th class="x-date-weeknumber-header"><a href="#" hidefocus="on" class="x-date-weeknumber" tabIndex="1"><em><span ',this.multiSelection?this.useQuickTips?' ext:qtip="'+this.selectMonthText+'" ':' title="'+this.selectMonthText+'" ':"",">"+this.weekName+"</span></em></a></th>");for(var n,d=this.dayNames,o=0,c=0,u=0,m=this.noOfMonth;o<7;++o)(n=this.startDay+o)>6&&(n-=7),h.push("<th><span>",d[n].substr(0,1),"</span></th>");for(h.push("</tr></thead><tbody><tr>"),this.showWeekNumber&&h.push('<td class="x-date-weeknumber-cell"><a href="#" hidefocus="on" class="x-date-weeknumber" tabIndex="1"><em><span ',l,"></span></em></a></td>");c<42;++c)c%7==0&&c>0&&(this.showWeekNumber?h.push('</tr><tr><td class="x-date-weeknumber-cell"><a href="#" hidefocus="on" class="x-date-weeknumber" tabIndex="1"><em><span ',l,"></span></em></a></td>"):h.push("</tr><tr>")),h.push('<td class="x-date-date-cell"><a href="#" hidefocus="on" class="x-date-date" tabIndex="1"><em><span ',-1!=this.weekendDays.indexOf((c+this.startDay)%7)?r:"","></span></em></a></td>");h.push("</tr></tbody></table></td></tr></table></td>");var D=h.join("");for(this.summarizeHeader&&this.noOfMonth>1&&(i.push('<td align="center" id="',this.id,'-summarize" colspan="',this.noOfMonthPerRow,'" class="x-date-middle x-date-pickerplus-middle"></td></tr>'),i.push("<tr>"));u<m;++u)i.push('<td><table class="x-date-pickerplus',u%this.noOfMonthPerRow==0?"":" x-date-monthtable",this.prevNextDaysView?"":" x-date-pickerplus-prevnexthide",'" cellspacing="0"><tr>'),0===u?(i.push('<td class="x-date-left">'),this.renderPrevNextButtons&&i.push('<a class="npm" href="#" ',this.useQuickTips?' ext:qtip="'+this.prevText+'" ':' title="'+this.prevText+'" ',"></a>"),this.renderPrevNextYearButtons&&i.push('<a class="npy" href="#" ',this.useQuickTips?' ext:qtip="'+this.prevYearText+'" ':' title="'+this.prevYearText+'" ',"></a>"),i.push("</td>")):i.push('<td class="x-date-dummy x-date-middle">',a,"</td>"),i.push("<td class='x-date-middle x-date-pickerplus-middle",0!==u||this.disableMonthPicker?"":" x-date-firstMonth","' align='center'>"),(u>0||this.disableMonthPicker)&&i.push('<span id="',this.id,"-monthLabel",u,'"></span>'),i.push("</td>"),u==this.noOfMonthPerRow-1?(i.push('<td class="x-date-right">'),this.renderPrevNextButtons&&i.push('<a class="npm" href="#" ',this.useQuickTips?' ext:qtip="'+this.nextText+'" ':' title="'+this.nextText+'" ',"></a>"),this.renderPrevNextYearButtons&&i.push('<a class="npy" href="#" ',this.useQuickTips?' ext:qtip="'+this.nextYearText+'" ':' title="'+this.nextYearText+'" ',"></a>"),i.push("</td>")):i.push('<td class="x-date-dummy x-date-middle">',a,"</td>"),i.push('</tr><tr><td colspan="3"><table class="x-date-inner" id="',this.id,"-inner-date",u,'" cellspacing="0">'),i.push(D),(u+1)%this.noOfMonthPerRow==0&&i.push("</tr><tr>");i.push("</tr>"),i.push("<tr><td",this.noOfMonthPerRow>1?' colspan="'+this.noOfMonthPerRow+'"':"",' class="x-date-bottom" align="center"><div><table width="100%" cellpadding="0" cellspacing="0"><tr><td align="right" class="x-date-multiokbtn">',a,'</td><td align="center" class="x-date-todaybtn">',a,'</td><td align="left" class="x-date-multiundobtn">',a,"</td></tr></table></div></td></tr>"),i.push('</table><div class="x-date-mp"></div>');var f=document.createElement("div");f.className="x-date-picker",f.innerHTML=i.join(""),e.dom.insertBefore(f,t),this.el=Ext.get(f),this.eventEl=Ext.get(f.firstChild),this.renderPrevNextButtons&&(this.leftClickRpt=new Ext.util.ClickRepeater(this.el.child("td.x-date-left a.npm"),{handler:this.showPrevMonth,scope:this,preventDefault:!0,stopDefault:!0}),this.rightClickRpt=new Ext.util.ClickRepeater(this.el.child("td.x-date-right a.npm"),{handler:this.showNextMonth,scope:this,preventDefault:!0,stopDefault:!0})),this.renderPrevNextYearButtons&&(this.leftYearClickRpt=new Ext.util.ClickRepeater(this.el.child("td.x-date-left a.npy"),{handler:this.showPrevYear,scope:this,preventDefault:!0,stopDefault:!0}),this.rightYearClickRpt=new Ext.util.ClickRepeater(this.el.child("td.x-date-right a.npy"),{handler:this.showNextYear,scope:this,preventDefault:!0,stopDefault:!0})),this.allowMouseWheel&&this.eventEl.on("mousewheel",this.handleMouseWheel,this),this.keyNav=new Ext.KeyNav(this.eventEl,{left:function(e){this.disabled||!e.ctrlKey||this.disableMonthPicker&&!this.renderPrevNextButtons?this.activeDateKeyNav(-1):this.showPrevMonth()},right:function(e){this.disabled||!e.ctrlKey||this.disableMonthPicker&&!this.renderPrevNextButtons?this.activeDateKeyNav(1):this.showNextMonth()},up:function(e){this.disabled||!e.ctrlKey||this.disableMonthPicker&&!this.renderPrevNextYearButtons?this.activeDateKeyNav(-7):this.showNextYear()},down:function(e){this.disabled||!e.ctrlKey||this.disableMonthPicker&&!this.renderPrevNextYearButtons?this.activeDateKeyNav(7):this.showPrevYear()},pageUp:function(e){this.disabled||this.update(this.activeDate.add("mo",-1*this.pageKeyWarp))},pageDown:function(e){this.disabled||this.update(this.activeDate.add("mo",this.pageKeyWarp))},enter:function(e){return e.stopPropagation(),this.disabled||(this.multiSelection?this.okClicked():this.finishDateSelection(this.activeDate)),!0},scope:this}),this.disableSingleDateSelection||this.eventEl.on("click",this.handleDateClick,this,{delegate:"a.x-date-date"}),this.multiSelection&&this.showWeekNumber&&this.eventEl.on("click",this.handleWeekClick,this,{delegate:"a.x-date-weeknumber"}),this.cellsArray=[],this.textNodesArray=[],this.weekNumberCellsArray=[],this.weekNumberTextElsArray=[],this.weekNumberHeaderCellsArray=[];for(var p,x,g,v,y,k=0,T=this.noOfMonth;k<T;++k)p=Ext.get(this.id+"-inner-date"+k).select("tbody td.x-date-date-cell"),x=Ext.get(this.id+"-inner-date"+k).query("tbody td.x-date-date-cell span"),this.cellsArray[k]=p,this.textNodesArray[k]=x,this.showWeekNumber&&(g=Ext.get(this.id+"-inner-date"+k).select("tbody td.x-date-weeknumber-cell"),v=Ext.get(this.id+"-inner-date"+k).select("tbody td.x-date-weeknumber-cell span"),this.weekNumberCellsArray[k]=g,this.weekNumberTextElsArray[k]=v,y=Ext.get(this.id+"-inner-date"+k).select("th.x-date-weeknumber-header"),this.weekNumberHeaderCellsArray[k]=y);if(this.disableMonthPicker||(this.monthPicker=this.el.down("div.x-date-mp"),this.monthPicker.enableDisplayMode("block"),this.mbtn=new Ext.Button({text:" ",tooltip:this.monthYearText,renderTo:this.el.child("td.x-date-firstMonth",!0)}),this.mbtn.on("click",this.showMonthPickerPlus,this),this.mbtn.el.child("em").addClass("x-btn-arrow")),this.renderTodayButton||this.showToday){this.todayKeyListener=this.eventEl.addKeyListener(Ext.EventObject.SPACE,this.spaceKeyPressed,this);var b=(new Date).dateFormat(this.format);this.todayBtn=new Ext.Button({renderTo:this.el.child("td.x-date-bottom .x-date-todaybtn",!0),text:String.format(this.todayText,b),tooltip:String.format(this.todayTip,b),handler:this.selectToday,scope:this})}this.multiSelection&&this.renderOkUndoButtons&&(this.OKBtn=new Ext.Button({renderTo:this.el.child("td.x-date-bottom .x-date-multiokbtn",!0),text:this.okText,handler:this.okClicked,scope:this}),this.undoBtn=new Ext.Button({renderTo:this.el.child("td.x-date-bottom .x-date-multiundobtn",!0),text:this.undoText,handler:function(){if(!this.disabled){this.fireEvent("undo",this,this.preSelectedDates),this.preSelectedDates=[];for(var e=0,t=this.selectedDates.length;e<t;++e)this.preSelectedDates.push(this.selectedDates[e].clearTime().getTime());this.update(this.activeDate)}},scope:this})),Ext.isIE&&this.el.repaint(),this.preSelectedDates=[];for(var E=0,w=this.selectedDates.length;E<w;++E)this.preSelectedDates.push(this.selectedDates[E].clearTime().getTime());this.update(this.value)},showMonthPickerPlus:function(){this.disabled||this.showMonthPicker()},convertCSSDatesToNumbers:function(e){for(var t=[[],[],[]],s=0,i=e.length;s<i;++s)t[0][s]=e[s].date.clearTime().getTime(),t[1][s]=e[s].text?e[s].text:this.defaultEventDatesText,t[2][s]=e[s].cls?e[s].cls:this.defaultEventDatesCls;return t},clearSelectedDates:function(e){void 0===e&&(e=!0),this.selectedDates=[],this.preSelectedDates=[],this.rendered&&e&&this.update(this.activeDate)},jsonDate:function(e){if(Ext.isArray(e))for(var t=0,s=e.length;t<s;t++)"string"==typeof e[t]&&(e[t]=Date.parseDate(e[t].replace(/T/," "),"Y-m-d H:i:s"));else if("string"==typeof e)return Date.parseDate(e.replace(/T/," "),"Y-m-d H:i:s");return e},setSelectedDates:function(e,t){void 0===t&&(t=!0),e=this.jsonDate(e),Ext.isArray(e)||(e=[e]);for(var s,i,a=0,l=e.length;a<l;++a)i=(s=e[a]).clearTime().getTime(),-1==this.preSelectedDates.indexOf(i)&&(this.preSelectedDates.push(i),this.selectedDates.push(s));this.rendered&&t&&this.update(this.activeDate)},setAllowedDates:function(e,t){void 0===t&&(t=!0),this.allowedDates=this.jsonDate(e),this.rendered&&t&&this.update(this.activeDate)},setMinDate:function(e){this.minDate=this.jsonDate(e),this.update(this.value,!0)},setMaxDate:function(e){this.maxDate=this.jsonDate(e),this.update(this.value,!0)},setDateLimits:function(e,t){this.minDate=this.jsonDate(e),this.maxDate=this.jsonDate(t),this.update(this.value,!0)},update:function(e,t,s){if(void 0===s&&(s=!1),void 0===t&&(t=!1),t){var i=new Date(this.activeDate.getTime());this.activeDate=null,e=i}var a=!(!this.displayMask||!(isNaN(this.displayMask)||this.noOfMonth>this.displayMask));if(!s&&a)return this.el.mask(this.displayMaskText),this.update.defer(10,this,[e,!1,!0]),!1;this.stayInAllowedRange&&(this.minDate||this.maxDate)&&(this.minDate&&(this.minDate.getFullYear()>e.getFullYear()||this.minDate.getMonth()>e.getMonth()&&this.minDate.getFullYear()==e.getFullYear())?e=new Date(this.minDate.getTime()):this.maxDate&&(this.maxDate.getFullYear()<e.getFullYear()||this.maxDate.getMonth()<e.getMonth()&&this.maxDate.getFullYear()==e.getFullYear())&&(e=new Date(this.maxDate.getTime())));var l=e.getMonth(),r=this.activeDate?this.activeDate.getMonth():l,h=e.getFullYear(),n=this.activeDate?this.activeDate.getFullYear():h;r!=l&&this.fireEvent("beforemonthchange",this,r,l),n!=h&&this.fireEvent("beforeyearchange",this,n,h),this.activeDate=e.clearTime(),this.preSelectedCells=[],this.lastSelectedDateCell="",this.activeDateCell="";var d=this.lastSelectedDate?this.lastSelectedDate:0,o=(new Date).clearTime().getTime(),c=this.minDate?this.minDate.clearTime().getTime():Number.NEGATIVE_INFINITY,u=this.maxDate?this.maxDate.clearTime().getTime():Number.POSITIVE_INFINITY,m=this.disabledDatesRE,D=this.disabledDatesText,f=!!this.disabledDays&&this.disabledDays.join(""),p=this.disabledDaysText,x=this.eventDatesRE,g=this.eventDatesRECls,v=this.eventDatesREText,y=this.allowedDatesText,k=this.format,T=this.activeDate.getTime();if(this.todayMonthCell=!1,this.todayDayCell=!1,this.allowedDates){this.allowedDatesT=[];for(var b=0,E=this.allowedDates.length;b<E;++b)this.allowedDatesT.push(this.allowedDates[b].clearTime().getTime())}this.minTextDetail=String.format(this.minText,Ext.form.DateField.prototype.formatDate(this.minValue||this.minDate)),this.maxTextDetail=String.format(this.maxText,Ext.form.DateField.prototype.formatDate(this.maxValue||this.maxDate));for(var w,C,S,M,N,P,A,R,O,B,Y,F,W,I,V,H,L,K=function(e,t,s,i){var a,l,r=Ext.get(t),h=Ext.get(s),n=i.getTime(),b=!1;t.title="",t.firstChild.dateValue=n;var E=i.getFullYear();e.lastRenderedYear!==E&&(e.lastRenderedYear=E,e.markNationalHolidays&&(e.nationalHolidaysNumbered=e.convertCSSDatesToNumbers(e.nationalHolidays(E))),e.eventDatesNumbered=e.convertCSSDatesToNumbers(e.eventDates(E))),n<c&&(t.className=" x-date-disabled",b=e.minTextDetail),n>u&&(t.className=" x-date-disabled",b=e.maxTextDetail),f&&-1!=f.indexOf(i.getDay())&&(b=p,t.className=" x-date-disabled"),m&&k&&(l=i.dateFormat(k),m.test(l)&&(b=D.replace("%0",l),t.className=" x-date-disabled")),e.allowedDates&&-1==e.allowedDatesT.indexOf(n)&&(t.className=" x-date-disabled",b=y),e.markWeekends&&-1!=e.weekendDays.indexOf(i.getDay())&&!r.hasClass("x-date-disabled")&&r.addClass(e.weekendCls),r.hasClass("x-date-disabled")&&!e.styleDisabledDates||(e.eventDatesNumbered[0].length>0&&-1!=(a=e.eventDatesNumbered[0].indexOf(n))&&""!==e.eventDatesNumbered[2][a]&&(r.addClass(e.eventDatesNumbered[2][a]+(e.eventDatesSelectable?"":"-disabled")),b=""!==e.eventDatesNumbered[1][a]&&e.eventDatesNumbered[1][a]),x&&k&&(l=i.dateFormat(k),x.test(l)&&(b=v.replace("%0",l),t.className=g))),r.hasClass("x-date-disabled")?e.disabledLetter&&(s.innerHTML=e.disabledLetter):(e.markNationalHolidays&&e.nationalHolidaysNumbered[0].length>0&&-1!=(a=e.nationalHolidaysNumbered[0].indexOf(n))&&(r.addClass(e.nationalHolidaysCls),b=""!==e.nationalHolidaysNumbered[1][a]&&e.nationalHolidaysNumbered[1][a]),-1!=e.preSelectedDates.indexOf(n)&&(r.addClass("x-date-selected"),e.preSelectedCells.push(t.firstChild.monthCell+"#"+t.firstChild.dayCell)),n==d&&(e.lastSelectedDateCell=t.firstChild.monthCell+"#"+t.firstChild.dayCell)),n==o&&(r.addClass("x-date-today"),b=e.todayText),e.showActiveDate&&n==T&&""===e.activeDateCell&&(r.addClass("x-datepickerplus-activedate"),e.activeDateCell=t.firstChild.monthCell+"#"+t.firstChild.dayCell),b&&(e.useQuickTips?Ext.QuickTips.register({target:h,text:b}):t.title=b)},j=[],U=0,z=this.noOfMonth;U<z;++U){if(this.summarizeHeader&&this.noOfMonth>1&&(0===U||U==this.noOfMonth-1)&&(j.push(this.monthNames[e.getMonth()]," ",e.getFullYear()),0===U&&j.push(" - ")),w=this.cellsArray[U].elements,C=this.textNodesArray[U],(this.markNationalHolidays||this.eventDates.length>0)&&this.useQuickTips)for(H=0,L=C.length;H<L;++H)Ext.QuickTips.unregister(C[H]);if(S=e.getDaysInMonth(),(M=e.getFirstDateOfMonth().getDay()-this.startDay)<=this.startDay&&(M+=7),P=(N=e.add("mo",-1)).getDaysInMonth()-M,S+=M,A=new Date(N.getFullYear(),N.getMonth(),P).clearTime(),R=0,this.showWeekNumber){for(B=this.weekNumberCellsArray[U].elements,Y=this.weekNumberTextElsArray[U].elements,(F=new Date(A)).setDate(F.getDate()+7),(W=this.weekNumberHeaderCellsArray[U].elements)[0].firstChild.monthValue=e.getMonth(),W[0].firstChild.dateValue=F.getTime(),W[0].firstChild.monthCell=U,W[0].firstChild.dayCell=0;R<B.length;)Y[R].innerHTML=F.getWeekOfYear(),B[R].firstChild.dateValue=F.getTime(),B[R].firstChild.monthCell=U,B[R].firstChild.dayCell=7*R,F.setDate(F.getDate()+7),R++;R=0}for(;R<M;++R)C[R].innerHTML=++P,w[R].firstChild.monthCell=U,w[R].firstChild.dayCell=R,A.setDate(A.getDate()+1),w[R].className="x-date-prevday",K(this,w[R],C[R],A);for(;R<S;++R)O=R-M+1,C[R].innerHTML=O,w[R].firstChild.monthCell=U,w[R].firstChild.dayCell=R,A.setDate(A.getDate()+1),w[R].className="x-date-active",K(this,w[R],C[R],A),A.getTime()==o&&(this.todayMonthCell=U,this.todayDayCell=R);for(var Q=0;R<42;++R)C[R].innerHTML=++Q,w[R].firstChild.monthCell=U,w[R].firstChild.dayCell=R,A.setDate(A.getDate()+1),w[R].className="x-date-nextday",K(this,w[R],C[R],A);0!==U||this.disableMonthPicker?Ext.get(this.id+"-monthLabel"+U).update(this.monthNames[e.getMonth()]+" "+e.getFullYear()):this.mbtn.setText(this.monthNames[e.getMonth()]+" "+e.getFullYear()),e=e.add("mo",1),this.internalRender||(V=(I=this.el.dom.firstChild).offsetWidth,this.el.setWidth(V+this.el.getBorderWidth("lr")),Ext.fly(I).setWidth(V),this.internalRender=!0)}this.summarizeHeader&&this.noOfMonth>1&&Ext.get(this.id+"-summarize").update(j.join(""));this.el.unmask(),r!=l&&this.fireEvent("aftermonthchange",this,r,l),n!=h&&this.fireEvent("afteryearchange",this,n,h)},beforeDestroy:function(){this.rendered&&(this.keyNav.disable(),this.keyNav=null,this.renderPrevNextButtons&&Ext.destroy(this.leftClickRpt,this.rightClickRpt),this.renderPrevNextYearButtons&&Ext.destroy(this.leftYearClickRpt,this.rightYearClickRpt),this.disableMonthPicker||Ext.destroy(this.monthPicker,this.mbtn),this.todayBtn&&this.todayBtn.destroy(),this.OKBtn&&this.OKBtn.destroy(),this.undoBtn&&this.undoBtn.destroy(),Ext.destroy(this.eventEl))},handleWeekClick:function(e,t){if(!this.disabled){e.stopEvent();var s,i,a,l=new Date(t.dateValue).getFirstDateOfWeek(this.startDay),r=0,h=t.monthCell,n=t.dayCell;switch(t.parentNode.tagName.toUpperCase()){case"TH":r=42,s=t.monthValue;break;case"TD":r=7}if(42==r&&!1!==this.fireEvent("beforemonthclick",this,s,this.lastStateWasSelected)||7==r&&!1!==this.fireEvent("beforeweekclick",this,l,this.lastStateWasSelected)){if(!Ext.EventObject.ctrlKey&&this.multiSelectByCTRL&&this.removeAllPreselectedClasses(),a=!0,this.disablePartialUnselect)for(var d=l,o=0;o<r;++o){if(i=d.getMonth(),(7==r||i===s)&&-1==this.preSelectedDates.indexOf(d.clearTime().getTime())){a=!1;break}d=d.add(Date.DAY,1)}var c=!1,u=1;this.strictRangeSelect&&(-1==this.preSelectedDates.indexOf(l.add(Date.DAY,-1).clearTime().getTime())&&!a||-1!=this.preSelectedDates.indexOf(l.add(Date.DAY,-1).clearTime().getTime())&&a)&&(c=!0,l=l.add(Date.DAY,r-1),u=-1),this.maxNotified=!1;for(var m,D=0;D<r;++D)i=l.getMonth(),m=c?r-1-D:D,7!=r&&i!==s||this.markDateAsSelected(l.clearTime().getTime(),!0,h,n+m,a),l=l.add(Date.DAY,u);42==r?this.fireEvent("aftermonthclick",this,s,this.lastStateWasSelected):this.fireEvent("afterweekclick",this,new Date(t.dateValue).getFirstDateOfWeek(this.startDay),this.lastStateWasSelected)}}},markDateAsSelected:function(e,t,s,i,a){var l=Ext.get(this.cellsArray[s].elements[i]);if((l.hasClass("x-date-prevday")||l.hasClass("x-date-nextday"))&&"mark"!==this.prevNextDaysView)return!1;if(this.multiSelection&&(Ext.EventObject.ctrlKey||t)){var r=new Date(e).add(Date.DAY,-1).clearTime().getTime(),h=new Date(e).add(Date.DAY,1).clearTime().getTime();if(-1==this.preSelectedDates.indexOf(e)){if(this.maxSelectionDays===this.preSelectedDates.length)return this.maxNotified||(!1!==this.fireEvent("beforemaxdays",this)&&Ext.Msg.alert(this.maxSelectionDaysTitle,this.maxSelectionDaysText.replace(/%0/,this.maxSelectionDays)),this.maxNotified=!0),!1;if(l.hasClass("x-date-disabled"))return!1;if(this.strictRangeSelect&&-1==this.preSelectedDates.indexOf(h)&&-1==this.preSelectedDates.indexOf(r)&&this.preSelectedDates.length>0)return!1;this.preSelectedDates.push(e),this.markSingleDays(s,i,!1),this.markGhostDatesAlso(s,i,!1),this.lastStateWasSelected=!0}else a&&(!this.strictRangeSelect||this.strictRangeSelect&&(-1==this.preSelectedDates.indexOf(h)&&-1!=this.preSelectedDates.indexOf(r)||-1!=this.preSelectedDates.indexOf(h)&&-1==this.preSelectedDates.indexOf(r)))&&(this.preSelectedDates.remove(e),this.markSingleDays(s,i,!0),this.markGhostDatesAlso(s,i,!0),this.lastStateWasSelected=!1)}else this.removeAllPreselectedClasses(),this.preSelectedDates=[e],this.preSelectedCells=[],this.markSingleDays(s,i,!1),this.markGhostDatesAlso(s,i,!1),this.lastStateWasSelected=!0;return this.lastSelectedDate=e,this.lastSelectedDateCell=s+"#"+i,this.multiSelection&&!this.renderOkUndoButtons&&this.copyPreToSelectedDays(),this.lastStateWasSelected},markSingleDays:function(e,t,s){s?(Ext.get(this.cellsArray[e].elements[t]).removeClass("x-date-selected"),this.preSelectedCells.remove(e+"#"+t)):(Ext.get(this.cellsArray[e].elements[t]).addClass("x-date-selected"),this.preSelectedCells.push(e+"#"+t))},markGhostDatesAlso:function(e,t,s){if("mark"==this.prevNextDaysView){var i,a=Ext.get(this.cellsArray[e].elements[t]);a.hasClass("x-date-prevday")&&e>0?(i=7*(5-Math.floor(t/7)),Ext.get(this.cellsArray[e-1].elements[t+i]).hasClass("x-date-nextday")&&(i-=7),this.markSingleDays(e-1,t+i,s)):a.hasClass("x-date-nextday")&&e<this.cellsArray.length-1?(i=28,this.cellsArray[e].elements[t].firstChild.firstChild.firstChild.innerHTML!=this.cellsArray[e+1].elements[t-i].firstChild.firstChild.firstChild.innerHTML&&(i=35),this.markSingleDays(e+1,t-i,s)):a.hasClass("x-date-active")&&(t<14&&e>0||t>27&&e<this.cellsArray.length-1)&&(t<14?(i=28,Ext.get(this.cellsArray[e-1].elements[t+i]).hasClass("x-date-nextday")||(i=35),t+i<42&&this.cellsArray[e].elements[t].firstChild.firstChild.firstChild.innerHTML==this.cellsArray[e-1].elements[t+i].firstChild.firstChild.firstChild.innerHTML&&this.markSingleDays(e-1,t+i,s)):(i=28,Ext.get(this.cellsArray[e+1].elements[t-i]).hasClass("x-date-prevday")||(i=35),t-i>=0&&this.cellsArray[e].elements[t].firstChild.firstChild.firstChild.innerHTML==this.cellsArray[e+1].elements[t-i].firstChild.firstChild.firstChild.innerHTML&&this.markSingleDays(e+1,t-i,s)))}},removeAllPreselectedClasses:function(){for(var e,t=0,s=this.preSelectedCells.length;t<s;++t)e=this.preSelectedCells[t].split("#"),Ext.get(this.cellsArray[e[0]].elements[e[1]]).removeClass("x-date-selected");this.preSelectedDates=[],this.preSelectedCells=[]},handleDateClick:function(e,t){e.stopEvent();var s=Ext.fly(t.parentNode);if(!this.disabled&&t.dateValue&&!s.hasClass("x-date-disabled")&&!s.hasClass("x-datepickerplus-eventdates-disabled")&&!1!==this.fireEvent("beforedateclick",this,t)&&(!s.hasClass("x-date-prevday")&&!s.hasClass("x-date-nextday")||"mark"==this.prevNextDaysView)){var i=Ext.EventObject;(!i.ctrlKey&&this.multiSelectByCTRL||i.shiftKey||!this.multiSelection)&&this.removeAllPreselectedClasses();var a=!((i.ctrlKey||this.multiSelectByCTRL)&&!i.shiftKey||!this.multiSelection);if(i.shiftKey&&this.multiSelection&&this.lastSelectedDate){var l,r=this.lastSelectedDate,h=t.dateValue,n=r<h?1:-1,d=this.lastSelectedDateCell.split("#"),o=parseInt(d[0],10),c=parseInt(d[1],10),u=0;this.maxNotified=!1;var m=this.activeDate.getFirstDateOfMonth().clearTime().getTime(),D=this.activeDate.add(Date.MONTH,this.noOfMonth-1).getLastDateOfMonth().clearTime().getTime();if(r<m||r>D){for(var f,p,x,g=this.minDate?this.minDate.clearTime().getTime():Number.NEGATIVE_INFINITY,v=this.maxDate?this.maxDate.clearTime().getTime():Number.POSITIVE_INFINITY,y=this.disabledDays?this.disabledDays.join(""):"",k=this.disabledDatesRE,T=this.format,b=!!this.allowedDates&&this.allowedDatesT;r<m||r>D;){if(f=new Date(r),p=!1,k&&(x=f.dateFormat(T),p=k.test(x)),!(r<g||r>v||-1!=y.indexOf(f.getDay())||p||b&&-1==b.indexOf(r))){if(this.maxSelectionDays===this.preSelectedDates.length){!1!==this.fireEvent("beforemaxdays",this)&&Ext.Msg.alert(this.maxSelectionDaysTitle,this.maxSelectionDaysText.replace(/%0/,this.maxSelectionDays));break}this.preSelectedDates.push(r)}r=new Date(r).add(Date.DAY,n).clearTime().getTime()}for(o=n>0?0:this.cellsArray.length-1,c=n>0?0:41,l=Ext.get(this.cellsArray[o].elements[c]);l.hasClass("x-date-prevday")||l.hasClass("x-date-nextday");)l.addClass("x-date-selected"),this.preSelectedCells.push(o+"#"+c),c+=n,l=Ext.get(this.cellsArray[o].elements[c])}for(;(h-r)*n>0&&o>=0&&o<this.cellsArray.length;)this.markDateAsSelected(r,a,o,c,!0),r=new Date(r).add(Date.DAY,n).clearTime().getTime(),(l=Ext.get(this.cellsArray[o].elements[c])).hasClass("x-date-active")?u=0:u++,42==(c+=n)?(o++,c=u>=7?14:7):c<0&&(o--,c=34,((l=Ext.get(this.cellsArray[o].elements[c])).hasClass("x-date-nextday")||7==u)&&(c=27))}this.markDateAsSelected(t.dateValue,a,t.monthCell,t.dayCell,!0)&&this.finishDateSelection(new Date(t.dateValue))}},copyPreToSelectedDays:function(){this.selectedDates=[];for(var e=0,t=this.preSelectedDates.length;e<t;++e)this.selectedDates.push(new Date(this.preSelectedDates[e]))},okClicked:function(){this.copyPreToSelectedDays(),this.selectedDates=this.selectedDates.sortDates(),this.fireEvent("select",this,this.selectedDates)},spaceKeyPressed:function(e){var t=!((Ext.EventObject.ctrlKey||this.multiSelectByCTRL)&&!Ext.EventObject.shiftKey||!this.multiSelection);if(!this.disabled&&this.shiftSpaceSelect==Ext.EventObject.shiftKey&&this.showActiveDate){var s=this.activeDateCell.split("#"),i=parseInt(s[0],10),a=parseInt(s[1],10);this.markDateAsSelected(this.activeDate.getTime(),t,i,a,!0),this.finishDateSelection(this.activeDate)}else this.selectToday()},finishDateSelection:function(e){this.setValue(e),this.multiSelection?this.fireEvent("afterdateclick",this,e,this.lastStateWasSelected):(this.fireEvent("afterdateclick",this,e,this.lastStateWasSelected),this.fireEvent("select",this,this.value))},selectToday:function(){if(!this.disabled&&this.todayBtn&&!this.todayBtn.disabled){var e=(new Date).clearTime(),t=e.getTime();"number"==typeof this.todayMonthCell?this.markDateAsSelected(t,!1,this.todayMonthCell,this.todayDayCell,!0):this.multiSelection&&this.update(e),this.finishDateSelection(e)}},setValue:function(e){Ext.isArray(e)?(this.selectedDates=[],this.preSelectedDates=[],this.setSelectedDates(e,!0),e=e[0]):this.setSelectedDates(e,!1),this.value=e.clearTime(!0),this.el&&!this.multiSelection&&1==this.noOfMonth&&this.update(this.value)},setSize:Ext.emptyFn}),Ext.reg("datepickerplus",Ext.ux.DatePickerPlus),parseInt(Ext.version.substr(0,1),10)>2?(Ext.menu.DateItem=Ext.ux.DatePickerPlus,Ext.override(Ext.menu.DateMenu,{initComponent:function(){this.on("beforeshow",this.onBeforeShow,this),(this.strict=Ext.isIE7&&Ext.isStrict)&&this.on("show",this.onShow,this,{single:!0,delay:20});var e=this.initialConfig.usePickerPlus?Ext.ux.DatePickerPlus:Ext.DatePicker;Ext.apply(this,{plain:!0,showSeparator:!1,items:this.picker=new e(Ext.apply({internalRender:this.strict||!Ext.isIE,ctCls:"x-menu-date-item",id:this.pickerId},this.initialConfig))}),this.picker.purgeListeners(),Ext.menu.DateMenu.superclass.initComponent.call(this),this.relayEvents(this.picker,["select"]),this.on("show",this.picker.focus,this.picker),this.on("select",this.menuHide,this),this.handler&&this.on("select",this.handler,this.scope||this)}})):(Ext.menu.DateItem=function(e){void 0===e&&(e={}),e.usePickerPlus?Ext.menu.DateItem.superclass.constructor.call(this,new Ext.ux.DatePickerPlus(Ext.applyIf({listeners:e.datePickerListeners||{}},e)),e):Ext.menu.DateItem.superclass.constructor.call(this,new Ext.DatePicker(Ext.applyIf({listeners:e.datePickerListeners||{}},e)),e),this.picker=this.component,this.addEvents("select"),this.picker.on("render",function(e){e.getEl().swallowEvent("click"),e.container.addClass("x-menu-date-item")}),this.picker.on("select",this.onSelect,this)},Ext.extend(Ext.menu.DateItem,Ext.menu.Adapter,{onSelect:function(e,t){this.fireEvent("select",this,t,e),e.rendered&&Ext.menu.DateItem.superclass.handleClick.call(this)}})),Ext.form&&Ext.form.DateField&&(Ext.ux.form.DateFieldPlus=Ext.extend(Ext.form.DateField,{showPrevNextTrigger:!1,clickRepeaterConfig:{},prevNextTriggerType:1,onPrevTriggerRelease:null,onNextTriggerRelease:null,showDeleteTrigger:!0,usePickerPlus:!0,showWeekNumber:!0,noOfMonth:1,noOfMonthPerRow:3,nationalHolidaysCls:"x-datepickerplus-nationalholidays",markNationalHolidays:!0,eventDates:function(e){return[]},eventDatesRE:!1,eventDatesRECls:"",eventDatesREText:"",multiSelection:!1,multiSelectionDelimiter:",",multiSelectByCTRL:!0,fillupRows:!0,markWeekends:!0,weekendText:"",weekendCls:"x-datepickerplus-weekends",weekendDays:[6,0],useQuickTips:!0,pageKeyWarp:1,maxSelectionDays:!1,resizable:!1,renderTodayButton:!0,renderOkUndoButtons:!0,tooltipType:"qtip",allowedDates:!1,allowedDatesText:"",renderPrevNextButtons:!0,renderPrevNextYearButtons:!1,disableMonthPicker:!1,showActiveDate:!1,shiftSpaceSelect:!0,disabledLetter:!1,allowMouseWheel:!0,summarizeHeader:!1,stayInAllowedRange:!0,disableSingleDateSelection:!1,eventDatesSelectable:!1,styleDisabledDates:!1,prevNextDaysView:"mark",allowOtherMenus:!1,onBeforeYearChange:function(e,t,s){return this.fireEvent("beforeyearchange",this,t,s,e)},onAfterYearChange:function(e,t,s){return this.fireEvent("afteryearchange",this,t,s,e)},onBeforeMonthChange:function(e,t,s){return this.fireEvent("beforemonthchange",this,t,s,e)},onAfterMonthChange:function(e,t,s){return this.fireEvent("aftermonthchange",this,t,s,e)},onAfterMonthClick:function(e,t,s){return this.fireEvent("aftermonthclick",this,t,s,e)},onAfterWeekClick:function(e,t,s){return this.fireEvent("afterweekclick",this,t,s,e)},onAfterDateClick:function(e,t,s){return this.fireEvent("afterdateclick",this,t,s,e)},onBeforeMonthClick:function(e,t,s){return this.fireEvent("beforemonthclick",this,t,s,e)},onBeforeWeekClick:function(e,t,s){return this.fireEvent("beforeweekclick",this,t,s,e)},onBeforeDateClick:function(e,t){return this.fireEvent("beforedateclick",this,t)},onBeforeMouseWheel:function(e,t){return this.fireEvent("beforemousewheel",this,t,e)},onBeforeMaxDays:function(e){return this.fireEvent("beforemaxdays",this,e)},onUndo:function(e,t){return this.fireEvent("undo",this,t,e)},createMenu:function(){this.menu||(this.menu=new Ext.menu.DateMenu({allowOtherMenus:this.allowOtherMenus,usePickerPlus:this.usePickerPlus,noOfMonth:this.noOfMonth,noOfMonthPerRow:this.noOfMonthPerRow,listeners:{beforeyearchange:{fn:this.onBeforeYearChange,scope:this},afteryearchange:{fn:this.onAfterYearChange,scope:this},beforemonthchange:{fn:this.onBeforeMonthChange,scope:this},aftermonthchange:{fn:this.onAfterMonthChange,scope:this},afterdateclick:{fn:this.onAfterDateClick,scope:this},aftermonthclick:{fn:this.onAfterMonthClick,scope:this},afterweekclick:{fn:this.onAfterWeekClick,scope:this},beforedateclick:{fn:this.onBeforeDateClick,scope:this},beforemonthclick:{fn:this.onBeforeMonthClick,scope:this},beforeweekclick:{fn:this.onBeforeWeekClick,scope:this},beforemousewheel:{fn:this.onBeforeMouseWheel,scope:this},beforemaxdays:{fn:this.onBeforeMaxDays,scope:this},undo:{fn:this.onUndo,scope:this}}}),this.relayEvents(this.menu,["select"])),this.menu.isVisible()?this.menu.hide():(this.disabledDatesRE&&(this.ddMatch=this.disabledDatesRE),"string"==typeof this.minDate&&(this.minDate=this.parseDate(this.minDate)),"string"==typeof this.maxDate&&(this.maxDate=this.parseDate(this.maxDate)),Ext.apply(this.menu.picker,{minDate:this.minValue||this.minDate,maxDate:this.maxValue||this.maxDate,disabledDatesRE:this.ddMatch,disabledDatesText:this.disabledDatesText,disabledDays:this.disabledDays,disabledDaysText:this.disabledDaysText,showToday:this.showToday,format:this.format,showWeekNumber:this.showWeekNumber,nationalHolidaysCls:this.nationalHolidaysCls,markNationalHolidays:this.markNationalHolidays,multiSelectByCTRL:this.multiSelectByCTRL,fillupRows:this.fillupRows,multiSelection:this.multiSelection,markWeekends:this.markWeekends,weekendText:this.weekendText,weekendCls:this.weekendCls,weekendDays:this.weekendDays,useQuickTips:this.useQuickTips,eventDates:this.eventDates,eventDatesRE:this.eventDatesRE,eventDatesRECls:this.eventDatesRECls,eventDatesREText:this.eventDatesREText,pageKeyWarp:this.pageKeyWarp,maxSelectionDays:this.maxSelectionDays,resizable:this.resizable,renderTodayButton:this.renderTodayButton,renderOkUndoButtons:this.renderOkUndoButtons,allowedDates:this.allowedDates,allowedDatesText:this.allowedDatesText,renderPrevNextButtons:this.renderPrevNextButtons,renderPrevNextYearButtons:this.renderPrevNextYearButtons,disableMonthPicker:this.disableMonthPicker,showActiveDate:this.showActiveDate,shiftSpaceSelect:this.shiftSpaceSelect,disabledLetter:this.disabledLetter,allowMouseWheel:this.allowMouseWheel,summarizeHeader:this.summarizeHeader,stayInAllowedRange:this.stayInAllowedRange,disableSingleDateSelection:this.disableSingleDateSelection,eventDatesSelectable:this.eventDatesSelectable,styleDisabledDates:this.styleDisabledDates,prevNextDaysView:this.prevNextDaysView,clickRepeaterConfig:this.clickRepeaterConfig}),this.menu.picker.on("select",function(e,t){this.setValue(t)},this))},onTriggerClick:function(){this.disabled||(this.createMenu(),"string"==typeof this.defaultValue&&(this.defaultValue=Date.parseDate(this.defaultValue,this.format)),this.menu.picker.setValue(this.getValue()||this.defaultValue||new Date),this.menu.show(this.el,"tl-bl?"),this.menu.focus())},setValue:function(e){if(Ext.isArray(e)){for(var t=[],s=0,i=e.length;s<i;++s)t.push(this.formatDate(e[s]));var a=t.join(this.multiSelectionDelimiter);Ext.form.DateField.superclass.setValue.call(this,a)}else Ext.form.DateField.superclass.setValue.call(this,this.formatDate(this.parseDate(e)))},validateValue:function(e){if(this.multiSelection){for(var t=e.split(this.multiSelectionDelimiter),s=!0,i=0,a=t.length;i<a;++i)Ext.ux.form.DateFieldPlus.superclass.validateValue.call(this,t[i])||(s=!1);return s}return Ext.ux.form.DateFieldPlus.superclass.validateValue.call(this,e)},getValue:function(){if(this.multiSelection){for(var e=(Ext.form.DateField.superclass.getValue.call(this)||"").split(this.multiSelectionDelimiter),t=[],s=0,i=e.length;s<i;++s){var a=this.parseDate(e[s]);a&&t.push(a)}return t.length>0?t:""}return Ext.ux.form.DateFieldPlus.superclass.getValue.call(this)},beforeBlur:function(){if(this.multiSelection)this.setValue(this.getRawValue().split(this.multiSelectionDelimiter));else{var e=this.parseDate(this.getRawValue());e&&this.setValue(e)}},submitFormat:"Y-m-d",submitFormatAddon:"-format",onResize:function(e,t){Ext.form.TriggerField.superclass.onResize.call(this,e,t);var s=this.trigger.getWidth(),i=s;this.showPrevNextTrigger&&!this.multiSelection&&(i+=this.prevTrigger.getWidth()+this.nextTrigger.getWidth()),this.showDeleteTrigger,isNaN(e)||this.el.setWidth(e-s),this.wrap.setWidth(this.el.getWidth()+i)},onRender:function(){Ext.ux.form.DateFieldPlus.superclass.onRender.apply(this,arguments),this.showPrevNextTrigger&&!this.multiSelection&&(this.createMenu(),this.prevTrigger=this.el.insertSibling({tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger x-datepickerplus-fieldprev"}),this.prevTrigger.addClassOnOver("x-form-trigger-over"),this.prevTrigger.addClassOnClick("x-form-trigger-click"),this.nextTrigger=this.trigger.insertSibling({tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger x-datepickerplus-fieldnext"},"after"),this.nextTrigger.addClassOnOver("x-form-trigger-over"),this.nextTrigger.addClassOnClick("x-form-trigger-click"),this.menuEvents&&(this.el.addClass("x-datepickerplus-prevnext-ext3"),this.nextTrigger.addClass("x-datepickerplus-prevnext-ext3-next"),this.prevTrigger.addClass("x-datepickerplus-prevnext-ext3-prev"),this.trigger.addClass("x-datepickerplus-prevnext-ext3-date")),this.prevTrigRpt=new Ext.util.ClickRepeater(this.prevTrigger,Ext.apply({},this.clickRepeaterConfig,{handler:function(e){var t=this.getValue(),s=new Date;if(Ext.isDate(t))if("m"===this.prevNextTriggerType){var i=t.getDate(),a=t.getMonth()-1,l=t.getFullYear(),r=0;-1==a?(a=11,l--):i>(r=new Date(l,a,1).getDaysInMonth())&&(i=r),s=new Date(l,a,i)}else s=new Date(t.getTime()-864e5*this.prevNextTriggerType+72e5);(!this.minDate||this.minDate&&s>=this.minDate)&&(this.setValue(s),this.menu.picker.setValue([s]))},listeners:{mouseup:function(e,t){"function"==typeof this.scope.onPrevTriggerRelease?this.scope.onPrevTriggerRelease(this.scope.menu.picker,this.scope.menu.picker.value):this.scope.menu.picker.fireEvent("select",this.scope.menu.picker,this.scope.menu.picker.value)}},scope:this,preventDefault:!0,stopDefault:!0})),this.nextTrigRpt=new Ext.util.ClickRepeater(this.nextTrigger,Ext.apply({},this.clickRepeaterConfig,{handler:function(e){var t=this.getValue(),s=new Date;if(Ext.isDate(t))if("m"===this.prevNextTriggerType){var i=t.getDate(),a=t.getMonth()+1,l=t.getFullYear(),r=0;12==a?(a=0,l++):i>(r=new Date(l,a,1).getDaysInMonth())&&(i=r),s=new Date(l,a,i)}else s=new Date(t.getTime()+864e5*this.prevNextTriggerType+72e5);(!this.maxDate||this.maxDate&&s<=this.maxDate)&&(this.setValue(s),this.menu.picker.setValue([s]))},listeners:{mouseup:function(e,t){"function"==typeof this.scope.onNextTriggerRelease?this.scope.onNextTriggerRelease(this.scope.menu.picker,this.scope.menu.picker.value):this.scope.menu.picker.fireEvent("select",this.scope.menu.picker,this.scope.menu.picker.value)}},scope:this,preventDefault:!0,stopDefault:!0})));var e=this.name||this.el.dom.name||this.id+this.submitFormatAddon;e==this.id&&(e+=this.submitFormatAddon),this.hiddenField=this.el.insertSibling({tag:"input",type:"hidden",name:e,value:this.formatHiddenDate(this.parseDate(this.value))},Ext.isIE?"after":"before"),this.hiddenName=e,this.el.dom.removeAttribute("name"),this.el.on({keyup:{scope:this,fn:this.updateHidden},blur:{scope:this,fn:this.updateHidden}}),this.setValue=this.setValue.createSequence(this.updateHidden),this.tooltip&&("object"==typeof this.tooltip?Ext.QuickTips.register(Ext.apply({target:this.trigger},this.tooltip)):this.trigger.dom[this.tooltipType]=this.tooltip)},onDestroy:function(){Ext.ux.form.DateFieldPlus.superclass.onDestroy.apply(this,arguments),this.prevTrigger&&(this.prevTrigRpt.destroy(),this.prevTrigger.removeAllListeners(),this.prevTrigger.remove()),this.nextTrigger&&(this.nextTrigRpt.destroy(),this.nextTrigger.removeAllListeners(),this.nextTrigger.remove()),this.deleteTrigger&&(this.deleteTrigger.removeAllListeners(),this.deleteTrigger.remove())},onDisable:function(){Ext.ux.form.DateFieldPlus.superclass.onDisable.apply(this,arguments),this.hiddenField&&this.hiddenField.dom.setAttribute("disabled","disabled")},onEnable:function(){Ext.ux.form.DateFieldPlus.superclass.onEnable.apply(this,arguments),this.hiddenField&&this.hiddenField.dom.removeAttribute("disabled")},formatHiddenDate:function(e){return Ext.isDate(e)?Ext.util.Format.date(e,this.submitFormat):e},formatMultiHiddenDate:function(e){for(var t,s=[],i=0,a=e.length;i<a;++i)s.push(this.formatHiddenDate(e[i]));t=s.join(this.multiSelectionDelimiter),this.hiddenField.dom.value=t},updateHidden:function(e){if(Ext.isArray(e))this.formatMultiHiddenDate(e);else{var t=this.getValue();Ext.isArray(t)?this.formatMultiHiddenDate(t):this.hiddenField.dom.value=this.formatHiddenDate(t)}}}),Ext.reg("datefieldplus",Ext.ux.form.DateFieldPlus));