Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > weird safari javascript bug...

weird safari javascript bug...
Thread Tools
gerbnl
Grizzled Veteran
Join Date: Jul 2002
Location: NOT America!
Status: Offline
Reply With Quote
Jul 24, 2003, 02:10 PM
 
while hacking a neat little javascript i ran into, what i consider, a really weird bug. The script runs fine in IE, camino, netscape en mozilla.

I wonder whether it is something with my installation of safari, because i really can't believe this came thru the beta testing... maybe one of you can verify for me?

-- begin --
var i=0;

for(i=1;i<365;i++) {
var effe = new Date(2003,0,i);
document.write(i + ": " + effe.getDate() + "/" + (effe.getMonth()+1) + "&lt;br&gt;");
}
-- end --

Hope i didn't make any typo's, but above simply should print a list of dates (european: day/month) Look what happens at 7/5 (7th may). I get:

126: 6/5
127: 7/5
128: 25/8
129: 26/8

it jump's over 3 months!!
and then:

255: 30/12
256: 31/12
257: 1/1
258: 2/1

see how it thinks the year is over at 256 (what a telltale number, huh? (and for that matter: so is 127)

anyone?
( Last edited by gerbnl; Jul 24, 2003 at 02:18 PM. )
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 01:19 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,