View Full Version : make calendar adjust to current Month

08-11-2005, 03:51 AM
I have this website at


If you click on the Calendar link on the left, a calendar comes up in the frame on the right...I have the calendar set to open a new window with a link to a special Message for each day of the month by clicking on that day. Not all of the days work, as I only loaded the first week or so, However, this IS the way I am wanting my calendar to look...

I need this type of calendar to tie itself to the date/time properties of the users computer and am at a loss as to how to do it. As it is now, I have to manually go in and change the month and year. I need to have the month and year change automatically with what is current. I am not married to this specific script I have here, but I want to keep the same look and functionality of the calendar. (centered popup window for each days link) Is there anyone who can show me how, even with a completely new code if necessary, to make this calendar do everything that it does now, but have it tied to the users computer date/time properties to automatically update the month and year as it changes?

Any help would be greatly appreciated.

Code is below

.tditem {
font-size: 12px;
color: BLACK;

<script language="javascript" type="text/javascript">

var month="AUGUST 2005";

// S1 M2 T3 W4 T5 F6 S7
var daystart = 2;
var ct = 0;

var dt=new Array();
dt[31]=new Array("1","day1.html");
dt[30]=new Array("2","day2.html");
dt[29]=new Array("3","day3.html");
dt[28]=new Array("4","day4.html");
dt[27]=new Array("5","day5.html");
dt[26]=new Array("6","day6.html");
dt[25]=new Array("7","day7.html");
dt[24]=new Array("8","day8.html");
dt[23]=new Array("9","day9.html");
dt[22]=new Array("10","day10.html");
dt[21]=new Array("11","day11.html");
dt[20]=new Array("12","day12.html");
dt[19]=new Array("13","day13.html");
dt[18]=new Array("14","day14.html");
dt[17]=new Array("15","day15.html");
dt[16]=new Array("16","day16.html");
dt[15]=new Array("17","day17.html");
dt[14]=new Array("18","day18.html");
dt[13]=new Array("19","day19.html");
dt[12]=new Array("20","day20.html");
dt[11]=new Array("21","day21.html");
dt[10]=new Array("22","day22.html");
dt[9]=new Array("23","day23.html");
dt[8]=new Array("24","day24.html");
dt[7]=new Array("25","day25.html");
dt[6]=new Array("26","day26.html");
dt[5]=new Array("27","day27.html");
dt[4]=new Array("28","day28.html");
dt[3]=new Array("29","day29.html");
dt[2]=new Array("30","day30.html");
dt[1]=new Array("31","day31.html");

// put the double slash in front of the dates not needed

function popup(theURL){

document.write('<center><table border=1 width=100% bgcolor="ffffff">');
document.write('<tr><td colspan=7><h1 align=center>'+ month + '</h1></td></tr>');

document.write('<tr align=center>');
document.write('<td><b>SAT</b></td></tr><tr valign=top align=center>');

for (var i=dt.length-1;i>=0;i--)
if (ct <= 8) {
if (ct == 0) {
if (daystart > 1) {
document.write('<td valign=top colspan=' + (daystart - 1) + '></td>');
ct = daystart;

document.write('<td><center><a href="#" value=' + dt[i][1] + ' onClick="popup(this.value)">' + dt[i][0] + '</a></center></td>');
ct = ct + 1;

if (ct == 8) {
document.write('</tr><tr valign=top align=center>');
ct = 1;





Imperial Spider

08-17-2005, 10:42 PM
If you need more info, please let me know, I would appreciate any help.

Imperial Spider