I ran across this:

alert(Date.parse('2/28/2008'))  // returns 3/1/2008

and found others have much more robust examples:  
http://mootools.net/shell/APWfn/2/

My quick take fix was to modify the build function in the mootools
library:

        handler: function(bits){
                bits = bits.slice(1).associate(parsed);
                var date = new Date().clearTime();

                // next 2 lines are the workaround to this "leap year bug"
                if ('Y' in bits) handle.call(date, 'Y', bits['Y']);
                if ('y' in bits) handle.call(date, 'y', bits['y']);
                // end workaround

                if ('d' in bits) handle.call(date, 'd', 1);
                if ('m' in bits) handle.call(date, 'm', 1);
                for (var key in bits) handle.call(date, key, bits[key]);
                return date;
        }

Any better suggestions on a workaround, perhaps along the lines of
adding my own date parser?


-- 
Subscription settings: 
http://groups.google.com/group/mootools-users/subscribe?hl=en

Reply via email to