[limb-svn] r7054 - in 3.x/trunk/limb/calendar: shared/js src/wact

svn at limb-project.com svn at limb-project.com
Thu Jun 5 15:43:39 MSD 2008


Author: 3dmax
Date: 2008-06-05 15:43:39 +0400 (Thu, 05 Jun 2008)
New Revision: 7054
URL: http://fisheye.limb-project.com/changelog/limb/?cs=7054

Modified:
   3.x/trunk/limb/calendar/shared/js/datewidget.js
   3.x/trunk/limb/calendar/src/wact/date3select.tag.php
Log:
-- date3select tag fix

Modified: 3.x/trunk/limb/calendar/shared/js/datewidget.js
===================================================================
--- 3.x/trunk/limb/calendar/shared/js/datewidget.js	2008-06-05 11:35:34 UTC (rev 7053)
+++ 3.x/trunk/limb/calendar/shared/js/datewidget.js	2008-06-05 11:43:39 UTC (rev 7054)
@@ -50,6 +50,12 @@
   this.setup_options(this.day_select, this.day_options(this.year, this.month), this.day);
 }
 
+DateWidget.prototype.change = function()
+{
+  this.remove_options(this.day_select);
+  this.setup_options(this.day_select, this.day_options(this.year, this.month), this.day);
+}
+
 DateWidget.prototype.setValue = function()
 {
   this.control.value = parseInt(this.year) + "-" + this.zerofill((parseInt(this.month)), 2) + "-" + this.zerofill(parseInt(this.day), 2);
@@ -58,7 +64,7 @@
     this.control.value = "";
   }
   this.value = this.control.value;
-  if (!this.show_default && !this.value) 
+  if (!this.show_default && !this.value)
   {
     this.setDefaultValue();
   }
@@ -75,17 +81,16 @@
 {
   switch (field)
   {
+    case "day":
+      this.day = this.day_select.value;
+    break;
     case "month":
       this.month = this.month_select.value;
-      this.init();
+      this.change();
     break;
-    case "day":
-      this.day = this.day_select.value;
-      this.init();
-    break;
     case "year":
       this.year = this.year_select.value;
-      this.init();
+      this.change();
     break;
   }
 }
@@ -97,11 +102,11 @@
   {
     if (Calendar._DEFOPT)
     {
-     	opts[opts.length] = {value: -1, text:Calendar._DEFOPT['year']};
+      opts[opts.length] = {value: -1, text:Calendar._DEFOPT['year']};
     }
     else
     {
-     	opts[opts.length] = {value: -1, text: '---'};
+      opts[opts.length] = {value: -1, text: '---'};
     }
   }
   for (var i=this.max_year; i>=this.min_year; i--)
@@ -172,7 +177,7 @@
       maxday = 31;
     break;
   }
-  
+
   for (var i=1; i<=maxday; i++)
   {
     opts[opts.length] = {value: i, text: i};

Modified: 3.x/trunk/limb/calendar/src/wact/date3select.tag.php
===================================================================
--- 3.x/trunk/limb/calendar/src/wact/date3select.tag.php	2008-06-05 11:35:34 UTC (rev 7053)
+++ 3.x/trunk/limb/calendar/src/wact/date3select.tag.php	2008-06-05 11:43:39 UTC (rev 7054)
@@ -13,6 +13,7 @@
  * @tag date3select
  * @forbid_end_tag
  * @req_attributes id
+ * @suppress_attributes lang year_class show_default min_year max_year
  * @package calendar
  * @version $Id: $
 */
@@ -46,19 +47,15 @@
     $widget = new lmbDate3SelectWidget($lang, $year_class, $month_class, $day_class, $show_default);
     if ($min_year)
     {
-      $widget -> setMinYear(intval($min_year));
+      $widget->setMinYear(intval($min_year));
     }
     if ($max_year)
     {
-      $widget -> setMaxYear(intval($max_year));
+      $widget->setMaxYear(intval($max_year));
     }
-    
 
     $code->writeHTML($widget->loadFiles() .
                      $widget->makeFields($this->getAttribute('id') ));
-
   }
-
 }
 
-



More information about the limb-svn mailing list