summaryrefslogtreecommitdiff
path: root/framework/Web
diff options
context:
space:
mode:
authorChristophe.Boulain <>2010-02-04 08:08:26 +0000
committerChristophe.Boulain <>2010-02-04 08:08:26 +0000
commit249e3ef66ffd9e10d34b0ab5b4f3efaec6fd507a (patch)
tree067c7fc6f5fe566cc2a0acf4ae9b9a5df4eca2cb /framework/Web
parentb8aed6893e0e00197a02fd782415e4f0ce2360da (diff)
Fixed TActiveDatePicker bug
Diffstat (limited to 'framework/Web')
-rwxr-xr-xframework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js b/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js
index 3aacda21..e96b63ec 100755
--- a/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js
+++ b/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js
@@ -46,9 +46,9 @@ Prado.WebUI.TActiveDatePicker = Class.extend(Prado.WebUI.TDatePicker,
var day = Prado.WebUI.TDatePicker.getDayListControl(this.control);
var month = Prado.WebUI.TDatePicker.getMonthListControl(this.control);
var year = Prado.WebUI.TDatePicker.getYearListControl(this.control);
- Event.observe (day, "change", this.onDateChanged.bindEvent(this));
- Event.observe (month, "change", this.onDateChanged.bindEvent(this));
- Event.observe (year, "change", this.onDateChanged.bindEvent(this));
+ if (day) Event.observe (day, "change", this.onDateChanged.bindEvent(this));
+ if (month) Event.observe (month, "change", this.onDateChanged.bindEvent(this));
+ if (year) Event.observe (year, "change", this.onDateChanged.bindEvent(this));
}
@@ -66,9 +66,12 @@ Prado.WebUI.TActiveDatePicker = Class.extend(Prado.WebUI.TDatePicker,
}
else
{
- var day = Prado.WebUI.TDatePicker.getDayListControl(this.control).selectedIndex+1;
- var month = Prado.WebUI.TDatePicker.getMonthListControl(this.control).selectedIndex;
- var year = Prado.WebUI.TDatePicker.getYearListControl(this.control).value;
+ var day = Prado.WebUI.TDatePicker.getDayListControl(this.control);
+ if (day) day=day.selectedIndex+1;
+ var month = Prado.WebUI.TDatePicker.getMonthListControl(this.control);
+ if (month) month=month.selectedIndex;
+ var year = Prado.WebUI.TDatePicker.getYearListControl(this.control);
+ if (year) year=year.value;
date=new Date(year, month, day, 0,0,0).SimpleFormat(this.Format, this);
}
if (typeof(this.options.OnDateChanged) == "function") this.options.OnDateChanged(this, date);