JRS: In article <aad5ec0a4038f8a9b2720f025f48db70@news.teranews.co m>,
seen in news:comp.lang.javascript, Treetop <treetop@netfront.net> posted
at Wed, 8 Oct 2003 16:28:04 :-[color=blue]
>I am creating a calendar with JavaScript. I want to be able to put
>date and time in an array and have a calendar display properly with 7
>columns. I am stuck at this point. Any help would be appreciated. I
>hope I formatted it properly for this group.
>
>
>
>var month="October 2003";
>
>var ct = 0;
>
>var dt=new Array();
>dt[1]=new Array("1,5:15-8");
>dt[2]=new Array("2,5-8");
>dt[3]=new Array("3,5-8");
>dt[4]=new Array("4,1-4:45");[/color]
There is no real need to store day-of-month in an array indexed by day-
of-month.
This line is wrong :
ct + '> + dt[i][0] + '<br>' + dt[i][1] + '
and in that region you need to count and adjust your } to match { - add
one after ct = 1; ?
i>=0 should be i>0 .
That at least gets you a Table showing.
if ( = ) should be if ( == ), twice.
That gets a multi-column table.
In the many new Array lines, put the first " after the ' .
Your move.
I think you write too much code at once, before testing. since you can
view pages locally, you should test after every step
You could start with the code of <URL:
http://www.merlyn.demon.co.uk/js-
date6.htm#DP> and replace LZ(Q) by dt[Q], using that array dt. Titivate
the layout; you'll need to pad the entries to constant width, and/or
perhaps change the buttons to table elements.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> JS maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.