From c4b96269e8b1a129612d813c25cf67e98b9dbc65 Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 25 Jun 2007 18:20:18 +0000 Subject: Fixed #635. --- HISTORY | 1 + .../Web/Javascripts/source/prado/datepicker/datepicker.js | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/HISTORY b/HISTORY index 277cbdc6..0376a0bb 100644 --- a/HISTORY +++ b/HISTORY @@ -8,6 +8,7 @@ BUG: Ticket#652 - OFFSET must be specified together with LIMIT for TScaffoldView BUG: Ticket#653 - TUrlMapping: ServiceId irgnored in URL-Map (Qiang) BUG: Ticket#488 - TActiveCustomValidator Is Bypassing My Callback (Wei) BUG: Ticket#620 - PRADO should not take over all of Prototype's Callbacks (Wei) +BUG: Ticket#635 - TDatePicker not correctly updating month (Christophe) BUG: TWizard Sidebar using TDataListItemRenderer has error (Qiang) BUG: TOutputCache crashes when a default button is set (Qiang) BUG: Fixed several typos in TDbCache (Qiang) 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") -- cgit v1.2.3