Extend Javascript Date Object

Posted by jAndy on Stack Overflow See other posts from Stack Overflow or by jAndy
Published on 2010-06-14T13:55:59Z Indexed on 2010/06/14 14:02 UTC
Read the original article Hit count: 198

Filed under:

Hi Folks,

I'm curious what would be the best practice to extend the Date constructor.

The problem I'm facing is, that the Internet Explorer (< 7+8) can't parse a date like

new Date('2010-05-11');

I have to admit that this is not a standard method to parse, anyways FireFox and Chrome perform well on that kind of date string.

Now I'm wondering, should I just split/parse/rebuild the string before calling new Date() or is there a more elegant solution ?

© Stack Overflow or respective owner

Related posts about JavaScript