parseDateString function in dateparse.js return wrong date for '2006-12-31'. I didn’t realise that you have to initialise a JavaScript Date object in a certain order; if you don’t weird bugs can result.
parseDateString function in dateparse.js return wrong date for '2006-12-31'. I didn’t realise that you have to initialise a JavaScript Date object in a certain order; if you don’t weird bugs can result.
Argh... If only you'd posted this one day earlier!
I have a PHP QuickForm control wrapped around the old version of Datebox which uses your parseDateString.js... Yesterday a client complained that selecting 2007-08-30 was wrapping around to the next month (like 2007-09-03). I used firebug to track down where the error was occuring and eventually found the comments on your post releasing the code (http://simonwillison.net/2003/Oct/6/betterDateInpu t/ ) that explained the problem. Reversed the order of the calls to setMonth and setDate and it worked...
I'm not really complaining (and appreciate the great idea and free code, btw) but it's just funny to have spent time tracking something down and then see the answer handed me on a plate the next day...
metapundit - 17th February 2007 20:20 - #