X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=Date.js;h=6f217a5d556ced3d05d021801a88a20197a4ab75;hp=dde1c86993f6c91c27b901aed9e42ed9ee16e4f4;hb=refs%2Fheads%2Fwip_alan_T5944_trim_leading_white_space_from;hpb=96debe97e36b1f5feb2190d5d6fdba1d36c9c77e diff --git a/Date.js b/Date.js index dde1c86993..6f217a5d55 100644 --- a/Date.js +++ b/Date.js @@ -704,8 +704,8 @@ Date.prototype.clearTime = function(clone){ }; // private -// safari setMonth is broken -if(Roo.isSafari){ +// safari setMonth is broken -- check that this is only donw once... +if(Roo.isSafari && typeof(Date.brokenSetMonth) == 'undefined'){ Date.brokenSetMonth = Date.prototype.setMonth; Date.prototype.setMonth = function(num){ if(num <= -1){ @@ -775,7 +775,7 @@ document.write(dt3); //returns 'Fri Oct 06 2006 07:30:00' */ Date.prototype.add = function(interval, value){ var d = this.clone(); - if (!interval || value === 0) return d; + if (!interval || value === 0) { return d; } switch(interval.toLowerCase()){ case Date.MILLI: d.setMilliseconds(this.getMilliseconds() + value);