Roo/DatePicker.js
authorAlan Knowles <alan@roojs.com>
Mon, 22 Oct 2012 09:50:02 +0000 (17:50 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 22 Oct 2012 09:50:02 +0000 (17:50 +0800)
Roo/DatePicker.js

index f4a274e..3f18000 100644 (file)
@@ -170,14 +170,14 @@ Roo.extend(Roo.DatePicker, Roo.Component, {
      */
     setValue : function(value){
         var old = this.value;
-        if (typeof(value) == 'undefined') {
-            value = new Date();
-        }
         
         if (typeof(value) == 'string') {
          
             value = Date.parseDate(value, this.format);
         }
+        if (!value) {
+            value = new Date();
+        }
         
         this.value = value.clearTime(true);
         if(this.el){