sync
authorjohn <john@roojs.com>
Thu, 13 Sep 2018 04:11:32 +0000 (12:11 +0800)
committerjohn <john@roojs.com>
Thu, 13 Sep 2018 04:11:32 +0000 (12:11 +0800)
Roo/bootstrap/DateField.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index 44edf98..8ab644f 100644 (file)
@@ -980,6 +980,13 @@ Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input,  {
         return true;
     },
     
+    reset : function()
+    {
+        this.date = this.viewDate = '';
+        
+        Roo.bootstrap.DateField.superclass.setValue.call(this, '');
+    },
+    
     setVisible : function(visible)
     {
         if(!this.getEl()){
index bef0ab7..92e923b 100644 (file)
@@ -19280,6 +19280,13 @@ Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input,  {
         return true;
     },
     
+    reset : function()
+    {
+        this.date = this.viewDate = '';
+        
+        Roo.bootstrap.DateField.superclass.setValue.call(this, '');
+    },
+    
     setVisible : function(visible)
     {
         if(!this.getEl()){
index 4b25e19..57eedde 100644 (file)
@@ -794,7 +794,7 @@ if(this.startDate!==-Infinity){this.startDate=this.parseDate(this.startDate);}th
 }return C;},moveYear:function(A,B){return this.moveMonth(A,B*12);},dateWithinRange:function(A){return A>=this.startDate&&A<=this.endDate;},remove:function(){this.picker().remove();},validateValue:function(A){if(this.getVisibilityEl().hasClass('hidden')){return true;
 }if(A.length<1){if(this.allowBlank){return true;}return false;}if(A.length<this.minLength){return false;}if(A.length>this.maxLength){return false;}if(this.vtype){var vt=Roo.form.VTypes;if(!vt[this.vtype](A,this)){return false;}}if(typeof this.validator=="function"){var B=this.validator(A);
 if(B!==true){return false;}}if(this.regex&&!this.regex.test(A)){return false;}if(typeof(this.parseDate(A))=='undefined'){return false;}if(this.endDate!==Infinity&&this.parseDate(A).getTime()>this.endDate.getTime()){return false;}if(this.startDate!==-Infinity&&this.parseDate(A).getTime()<this.startDate.getTime()){return false;
-}return true;},setVisible:function(A){if(!this.getEl()){return;}this.getEl().removeClass('hidden');if(A){return;}this.getEl().addClass('hidden');}});Roo.apply(Roo.bootstrap.DateField,{head:{tag:'thead',cn:[{tag:'tr',cn:[{tag:'th',cls:'prev',html:'<i class="fa fa-arrow-left"/>'}
+}return true;},reset:function(){this.date=this.viewDate='';Roo.bootstrap.DateField.superclass.setValue.call(this,'');},setVisible:function(A){if(!this.getEl()){return;}this.getEl().removeClass('hidden');if(A){return;}this.getEl().addClass('hidden');}});Roo.apply(Roo.bootstrap.DateField,{head:{tag:'thead',cn:[{tag:'tr',cn:[{tag:'th',cls:'prev',html:'<i class="fa fa-arrow-left"/>'}
 ,{tag:'th',cls:'switch',colspan:'5'},{tag:'th',cls:'next',html:'<i class="fa fa-arrow-right"/>'}]}]},content:{tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:'7'}]}]},footer:{tag:'tfoot',cn:[{tag:'tr',cn:[{tag:'th',colspan:'7',cls:'today'}]}]},dates:{en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today"}
 },modes:[{clsName:'days',navFnc:'Month',navStep:1},{clsName:'months',navFnc:'FullYear',navStep:1},{clsName:'years',navFnc:'FullYear',navStep:10}]});Roo.apply(Roo.bootstrap.DateField,{template:{tag:'div',cls:'datepicker dropdown-menu roo-dynamic',cn:[{tag:'div',cls:'datepicker-days',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.DateField.head,{tag:'tbody'}
 ,Roo.bootstrap.DateField.footer]}]},{tag:'div',cls:'datepicker-months',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.DateField.head,Roo.bootstrap.DateField.content,Roo.bootstrap.DateField.footer]}]},{tag:'div',cls:'datepicker-years',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.DateField.head,Roo.bootstrap.DateField.content,Roo.bootstrap.DateField.footer]}