javascript getDay() behaves differently in 10.5/IE/FF (bug?)

Forums » Opera for Windows/Mac/Linux » Opera browser

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

22. April 2010, 16:09:39

tmpease

Posts: 38

javascript getDay() behaves differently in 10.5/IE/FF (bug?)

I use a javascript calendar that use getDay(), and as of v10.5 is off by a day. Try this:

foo = new Date("January 1, 2010");
document.write( foo.getDay() );

Writes 4 in opera, but writes 5 in Internet Explorer and Firefox.
Opera would be right if "0" was monday, but "0" has been sunday since Javascript 1.0.

Javascript 1.5 is sunday-based. See
https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getDay

Sounds like a bug in Opera's new Javascript engine to me.

29. April 2010, 15:23:22

tmpease

Posts: 38

Apparently Fixed on version 10.52 .
Not on changelog, though.

Forums » Opera for Windows/Mac/Linux » Opera browser