From ace6deee7bdf33a8795ff7291b880484c662f45b Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Mon, 11 Aug 2008 08:01:28 +0000 Subject: [PATCH] fix for a "too much recursion" JavaScript error in calendar.js, when the user tries to pick another year; the fix was taken from dynarch.com provided by a user named ilyaf. Thanks, --- phpgwapi/js/jscalendar/calendar.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/phpgwapi/js/jscalendar/calendar.js b/phpgwapi/js/jscalendar/calendar.js index 2077bf90b6..a385c92d7c 100644 --- a/phpgwapi/js/jscalendar/calendar.js +++ b/phpgwapi/js/jscalendar/calendar.js @@ -1774,15 +1774,16 @@ Date.prototype.print = function (str) { return str; }; -Date.prototype.__msh_oldSetFullYear = Date.prototype.setFullYear; -Date.prototype.setFullYear = function(y) { - var d = new Date(this); - d.__msh_oldSetFullYear(y); - if (d.getMonth() != this.getMonth()) - this.setDate(28); - this.__msh_oldSetFullYear(y); +if ( !Date.prototype.__msh_oldSetFullYear ) { + Date.prototype.__msh_oldSetFullYear = Date.prototype.setFullYear; + Date.prototype.setFullYear = function(y) { + var d = new Date(this); + d.__msh_oldSetFullYear(y); + if (d.getMonth() != this.getMonth()) + this.setDate(28); + this.__msh_oldSetFullYear(y); + }; }; - // END: DATE OBJECT PATCHES