Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Jake Jarvis Newsgroups: comp.lang.javascript Subject: Re: setDate() Date: Thu, 15 Dec 2011 01:09:28 +0100 Lines: 19 Message-ID: <9kss5oFfhrU2@mid.uni-berlin.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 8tRXWrAsAyRQ9SX+Oci3cgqsZGxL/CEowu/baitJ6z66YU7yQ= User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.javascript:9251 On 15.12.2011 01:00, Gene Wirchenko wrote: > Dear JavaScripters: > > I have just about finished my date class. One of the last > consequential functions is to add/subtract days from a date. > > In IE9, with Date, one can do > SomeDate.setDate(SomeDate.getDate()+n); > and if there is overflow in the days of the month, the date will be > normalised. e.g. 2011-12-31 + 32 = 2012-02-01. > > Is this behaviour that I can count on? It seems to fail at 366 > days. What do you mean with "fail at 366 days"? -- Jake Jarvis