Roo/bootstrap/DateField.js
[roojs1] / Roo / bootstrap / DateField.js
index 4a5fe1f..9c25a53 100644 (file)
@@ -930,6 +930,10 @@ Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input,  {
     
     validateValue : function(value)
     {
+        if(this.getVisibilityEl().hasClass('hidden')){
+            return true;
+        }
+        
         if(value.length < 1)  {
             if(this.allowBlank){
                 return true;
@@ -960,12 +964,36 @@ Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input,  {
             return false;
         }
         
-//        if (this.endDate !== Infinity) {
-//            this.endDate = this.parseDate(this.endDate);
-//        }      
+        if(typeof(this.parseDate(value)) == 'undefined'){
+            return false;
+        }
+        
+        if (this.endDate !== Infinity && this.parseDate(value).getTime() > this.endDate.getTime()) {
+            return false;
+        }      
+        
+        if (this.startDate !== -Infinity && this.parseDate(value).getTime() < this.startDate.getTime()) {
+            return false;
+        } 
+        
         
         return true;
     },
+    
+    setVisible : function(visible)
+    {
+        if(!this.getEl()){
+            return;
+        }
+        
+        this.getEl().removeClass('hidden');
+        
+        if(visible){
+            return;
+        }
+        
+        this.getEl().addClass('hidden');
+    }
    
 });