try myDate = new Date(2008, 3, 6,0,0,0,0); //use new Date(2008, 2, 8,0,0,0,0) for US myDate.date += 1; instead, eh?
I suspect mutating myDate.time is looked at as low level manipulation for special cases. Just a guess. DK On Mon, May 19, 2008 at 1:55 AM, Dmitri Girski <[EMAIL PROTECTED]> wrote: > Hi Alex, > > Here is the bug when you set correct value and get incorrect result. > > https://bugs.adobe.com/jira/browse/SDK-14983 > adding 24 hours does will not cause switching to the next date if it > happens over the daylight saving change date [summer->winter]) > > Cheers, > Dmitri. > > > --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>, "Alex > Harui" <[EMAIL PROTECTED]> wrote: > > > > I would not guarantee results if you set values that are out of range. > > > > ________________________________ > > > > From: flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com> [mailto: > flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>] On > > Behalf Of Amy > > Sent: Friday, May 16, 2008 2:31 PM > > To: flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com> > > Subject: [flexcoders] bug in setMonth() method? > > > > > > > > Hi, all; > > > > I'm working on making an app that will allow users to navigate from > > one month to the next based on a start date and end date. I noticed > > some interesting effects with the date object and days that fall > > outside the 1-31 range (http://tinyurl.com/5qc46j > > <http://tinyurl.com/5qc46j> ), so I thought I'd > > try something similar with months. > > > > What I find is if the current month is 11 and you add 1 to it, you'll > > actually wind up with a date that's not in the _next_ year, but one > > in the year following. > > > > Here's my code > > > > public function makeDisplayedMonths(beginDate:Date, endDate:Date):void > > { > > var today:Date= new Date(); > > //set up date for loop > > var parseDate:Date = beginDate; > > //equalize parsedate and enddate > > parseDate.setDate(1); > > endDate.setDate(1); > > while (parseDate <= endDate) { > > //update date > > parseDate.setMonth(++parseDate.month); > > trace(parseDate, endDate); > > } > > } > > > > the trace is this > > > > Tue Jul 1 00:00:00 GMT-0500 2008 Thu Jan 1 00:00:00 GMT-0600 2009 > > Fri Aug 1 00:00:00 GMT-0500 2008 Thu Jan 1 00:00:00 GMT-0600 2009 > > Mon Sep 1 00:00:00 GMT-0500 2008 Thu Jan 1 00:00:00 GMT-0600 2009 > > Wed Oct 1 00:00:00 GMT-0500 2008 Thu Jan 1 00:00:00 GMT-0600 2009 > > Sat Nov 1 00:00:00 GMT-0500 2008 Thu Jan 1 00:00:00 GMT-0600 2009 > > Mon Dec 1 00:00:00 GMT-0600 2008 Thu Jan 1 00:00:00 GMT-0600 2009 > > Fri Jan 1 00:00:00 GMT-0600 2010 Thu Jan 1 00:00:00 GMT-0600 2009 > > > > Note that it goes from Dec 1 2008 to Jan 1 2010, skipping 2009 > > altogether. > > > > Obviously now I know this I can code around it, but it seems like it > > should either throw an error that the month is out of range or just > > keep incrementing. > > > > Or have I missed something here? > > > > Thanks; > > > > Amy > > > > > -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?