Roo/form/MonthField.js
authorAlan Knowles <alan@roojs.com>
Mon, 22 Oct 2012 11:18:39 +0000 (19:18 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 22 Oct 2012 11:18:39 +0000 (19:18 +0800)
Roo/form/MonthField.js

index d7ae28a..421c088 100644 (file)
@@ -250,6 +250,10 @@ monthField.setValue('2006-5-4');
      */
     setValue : function(date){
         Roo.log('month setValue' + date);
+        // can only be first of month..
+        
+        var val = this.parseDate(date);
+        
         if (this.hiddenField) {
             this.hiddenField.value = this.formatDate(this.parseDate(date), 'Y-m-d');
         }
@@ -264,7 +268,7 @@ monthField.setValue('2006-5-4');
         }
         var v = Date.parseDate(value, this.format);
         if (!v && this.useIso) {
-            v = Date.parseDate(value, 'Y-m-d');
+            v = Date.parseDate(value, 'Y-m-01');
         }