summaryrefslogtreecommitdiff
path: root/framework/Web
diff options
context:
space:
mode:
authorxue <>2007-06-25 18:20:18 +0000
committerxue <>2007-06-25 18:20:18 +0000
commitc4b96269e8b1a129612d813c25cf67e98b9dbc65 (patch)
tree759016557bfcb292af4ba7fff18b056a0294f946 /framework/Web
parentdb685ed372f5aba3130f8b51df440d802dd2233b (diff)
Fixed #635.
Diffstat (limited to 'framework/Web')
-rw-r--r--framework/Web/Javascripts/source/prado/datepicker/datepicker.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/framework/Web/Javascripts/source/prado/datepicker/datepicker.js b/framework/Web/Javascripts/source/prado/datepicker/datepicker.js
index 262e0c1c..6dddeaad 100644
--- a/framework/Web/Javascripts/source/prado/datepicker/datepicker.js
+++ b/framework/Web/Javascripts/source/prado/datepicker/datepicker.js
@@ -508,6 +508,7 @@ Prado.WebUI.TDatePicker.prototype =
setMonth : function (month)
{
var d = this.newDate(this.selectedDate);
+ d.setDate(Math.min(d.getDate(), this.getDaysPerMonth(month,d.getFullYear())));
d.setMonth(month);
this.setSelectedDate(d);
},
@@ -522,6 +523,16 @@ Prado.WebUI.TDatePicker.prototype =
this.setMonth(this.selectedDate.getMonth()-1);
},
+ getDaysPerMonth : function (month, year)
+ {
+ month = (Number(month)+12) % 12;
+ var days = [31,28,31,30,31,30,31,31,30,31,30,31];
+ var res = days[month];
+ if (month == 1 && ((!(year % 4) && (year % 100)) || !(year % 400))) //feburary, leap years has 29
+ res++;
+ return res;
+ },
+
getDatePickerOffsetHeight : function()
{
if(this.options.InputMode == "TextBox")