tags:

views:

177

answers:

3
+2  A: 

After retrying the code after noticing the comment about May being wrong, here's some code that seems to work much better:

replace this block of code (from the original javascript code):

startspaces = thisdate;
while (startspaces > 7) {
    startspaces -= 7;
    startspaces = thisday - startspaces + 1;
}
if (startspaces < 0) {
    startspaces += 7;
}

with this single line of code:

startspaces = thisday;

Note that I use thisday and not thisdate here.

This seems to work for all of 2009.

Lasse V. Karlsen
I think there is still some problem with the calendar? the date on May starts at monday not on friday? img515.imageshack.us/img515/2927/cal.jpg
sayuki288
Yes, there's apparently more bugs here. I think you should follow the other's advice to find a better control for this.
Lasse V. Karlsen
i just made another thread about this
sayuki288
where can i find a better calendar script?
sayuki288
A: 

Solved the problem found a control as you said, never using this script again.

sayuki288
+3  A: 

This javascript-calendar is very nice, easy to customize and no server-callbacks: http://www.codeproject.com/KB/scripting/DropCalendar.aspx

Tuomas Hietanen