Mikor van a szülinapom,naptár:
Free JavaScripts
provided
by The'>http://javascriptsource.com">The
JavaScript Source
Normál kalendárium:
body {
background-color : #effeff;
}
div.hol {
background-color : yellow;
}
td.outer {
cellpadding : 1em;
border : solid blue;
}
table.inner {
background-color : #efefdd;
font-size : 8pt;
}
var months = ["January","February","March","April","May","June","July","August","September","October","November","December"];
var daycounts = [31,28,31,30,31,30,31,31,30,31,30,31]; //for leap years, remember to set february to 29 days
//2002 firstdays = [1,4,4,0,2,5,0,3,6,1,4,6];
var firstdays = [2,5,5,1,3,6,1,4,0,2,5,0];
//2004 firstdays = [3,6,7,3,5,1,3,6,2,4,0,2];
// This is where you put in the appointments. follow pattern [fromday,frommonth,today,tomonth,message]
var apps = [
[15,3,13,4,"Holiday in New Zealand"],
[12,6,12,6,"my birthday"],
[28,8,2,9,"Trip to Paris"],
[22,11,22,11,"Party with colleagues"],
[20,12,30,12,"Christmas with family"]
];
function CheckDate(month,dayno)
{
var retval = new String(dayno);
var m = month + 1;
for(var app = 0; app < apps.length; app++)
{
if(m == apps[app][1] ) //first month
{
if(apps[app][3] - apps[app][1] > 0)
{
if(dayno >= apps[app][0])
{
retval = " " + dayno + " ";
}
}
else
{
if(dayno >= apps[app][0] && dayno <= apps[app][2])
{
retval = " " + dayno + " ";
}
}
}
else if(m == apps[app][3]) // second month
{
if(dayno <= apps[app][2])
{
retval = " " + dayno + " ";
}
}
else if( m > apps[app][1] && m < apps[app][3] )
{
retval = " " + dayno + " ";
}
}
return retval;
}
function PrintMonth(month)
{
var done = false;
var day = 0;
document.write(" " + months[month] + "");
document.write(" Mon | Tue | Wed | Thu | Fri | Sat | Sun | ");
while(!done)
{
document.write(" ");
PrintWeek(month,day, firstdays[month], daycounts[month]);
document.write(" ");
day = day + 7;
if( day > daycounts[month] + firstdays[month])
{
done = true;
}
}
document.write(" ");
}
function PrintWeek(monthno,start,min,max)
{
var d;
var desc;
for(var j = 0; j < 7; j++)
{
document.write(" | ");
d = start + j;
if(d >= min && d < max + min)
{
desc = CheckDate(monthno,d - min + 1);
document.write(desc);
}
document.write(" | ");
}
}
Kalendárium 2006