Roo/bootstrap/DateField.js
[roojs1] / roojs-bootstrap.js
index 1d61c76..ca12ec9 100644 (file)
@@ -782,7 +782,7 @@ A-=1;for(var i=-1;i<11;i++){this.picker().select('>.datepicker-years tbody td',t
 return;}this.picker().addClass('bottom');this.picker().setTop(this.inputEl().getBottom()).setLeft(this.inputEl().getLeft());},parseDate:function(A){if(!A||A instanceof Date){return A;}var v=Date.parseDate(A,this.format);if(!v&&(this.useIso||A.match(/^(\d{4})-0?(\d+)-0?(\d+)/))){v=Date.parseDate(A,'Y-m-d');
 }if(!v&&this.altFormats){if(!this.altFormatsArray){this.altFormatsArray=this.altFormats.split("|");}for(var i=0,B=this.altFormatsArray.length;i<B&&!v;i++){v=Date.parseDate(A,this.altFormatsArray[i]);}}return v;},formatDate:function(A,B){return (!A||!(A instanceof Date))?A:A.dateFormat(B||this.format);
 },onFocus:function(){Roo.bootstrap.DateField.superclass.onFocus.call(this);this.showPopup();},onBlur:function(){Roo.bootstrap.DateField.superclass.onBlur.call(this);var d=this.inputEl().getValue();this.setValue(d);this.hidePopup();},showPopup:function(){this.picker().show();
-this.update();this.place();this.fireEvent('showpopup',this,this.date);},hidePopup:function(){if(this.isInline){return;}this.viewMode=this.startViewMode;this.showMode();this.fireEvent('hidepopup',this,this.date);},onMousedown:function(e){e.stopPropagation();
+this.update();this.place();this.fireEvent('showpopup',this,this.date);},hidePopup:function(){if(this.isInline){return;}this.picker().hide();this.viewMode=this.startViewMode;this.showMode();this.fireEvent('hidepopup',this,this.date);},onMousedown:function(e){e.stopPropagation();
 e.preventDefault();},keyup:function(e){Roo.bootstrap.DateField.superclass.keyup.call(this);this.update();},setValue:function(v){if(this.fireEvent('beforeselect',this,v)!==false){var d=new Date(this.parseDate(v)).clearTime();if(isNaN(d.getTime())){this.date=this.viewDate='';
 Roo.bootstrap.DateField.superclass.setValue.call(this,'');return;}v=this.formatDate(d);Roo.bootstrap.DateField.superclass.setValue.call(this,v);this.date=new Date(d.getTime()-d.getTimezoneOffset()*60000);this.update();this.fireEvent('select',this,this.date);
 }},getValue:function(){return this.formatDate(this.date);},fireKey:function(e){if(!this.picker().isVisible()){if(e.keyCode==27){this.showPopup();}return;}var A=false,B,C,D,E,F;switch(e.keyCode){case 27:this.hidePopup();e.preventDefault();break;case 37:case 39:if(!this.keyboardNavigation){break;