PDA

View Full Version : Basic Calender



UserDynamic
09-04-2009, 04:14 AM
Dear buddies,
I went through the dynamicdrive website and i found it is very helpful. In this i am trying to use the basic calender but what i need is i don't want the last column of the days.

Please help me soon.

Thanks
UserDynamic

davelf
09-04-2009, 04:48 AM
copy all the code, and paste it into blank html.


<html>

<head></head>
<style type="text/css">
body {
color: white;
}
</style>

<body bgcolor = "black">
<table border="0">
<tr>
<td>
<script language="JavaScript">
function show() {
var date = new Date();
time = date.toLocaleString();
document.write("<div align=center>"+time+"</div>");
document.write("<p><strong>Todays</strong></p>");
}
function array_month(m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11)
{
this[0] = m0;this[1] = m1;this[2] = m2;this[3] = m3;this[4] = m4;this[5] = m5;this[6] = m6;this[7] = m7;this[8] = m8;this[9] = m9;this[10] = m10;this[11] = m11;
}
function calender()
{
var date = new Date();
var day;
var jumlah_day = new array_month(31, 28, 31, 30, 31, 30, 31, 31, 30,31, 30, 31);
year = date.getYear() + 1900;
day = date.getDate();
var kolom_tabel = 0;
if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))
jumlah_day[1] = 29;
total_day = jumlah_day[date.getMonth()];
value_day = date;
value_day.setDate(1);
cek_day = value_day.getDate();
if (cek_day == 2)
value_day.setDate(0);
show_day = value_day.getDay();
document.write("<TABLE><TR><TH>Sun<TH>Mon<TH>Tue<TH>Wed<TH>Thr<TH>Fri<TH>Sat<TR>");
for (i=0; i<show_day; i++)
{
document.write("<TD>");
kolom_tabel++;
}
for (i=1; i<=total_day; i++)
{
document.write("<TD>");
if (i == day)
document.write("<strong><FONT COLOR=red>")
document.write(i);
if (i == day)
document.write("</FONT></strong>")
kolom_tabel++;
if (kolom_tabel == 7)
{
document.write("<TR>");
kolom_tabel = 0;
}
}
document.write("</TABLE>");
}

show();
calender();

</script>
</td>
</tr>
</table>
</body>

</html>


good luck...:)

UserDynamic
09-04-2009, 05:19 AM
Hi Davelf,
Thanks you very much for prompt reply. I want to use your basic calender which you have designed in your web. But only thing is that i just want to remove the last row since there is extra rows and occupying the spaces in my web.

Please do help to me and it is very in need.

Thanks you
Userdynamic

davelf
09-04-2009, 11:59 AM
sorry but i don't see any extra row here, can you give a link to your page, or some screen shoot about that extra row.

UserDynamic
09-07-2009, 10:47 AM
Thanks for your support, i have solved as per what you said. Looking for more help in future.

davelf
09-07-2009, 12:50 PM
your welcome, just post your question at this forum in the future, hehe.