Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to make calendar automatically display special events

843836Apr 30 2004 — edited Apr 30 2004
hi, i wanted to make my calendar automatic display the events in a specific month. should i use ifelse statement or switch case statement? my web site have display calendar for the current month. it aotumatically update. now i wanted to highlight the special event on that month like New Year, Christmas etc. it automatically change the event according to the month. when it comes to May, it won't display April event but May event such as Labour Day. this is the example, what i wanted it to be is the event date changes according to the month.



<html>
<head>
<title>Brunsfield e-Homes</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="home.css">

<style type="text/css">

.main {
width:130px;
border:0px solid #8D549B;
border-collapse:collapse;
}

.month {
background-color:#8D549B;
font:bold 11px arial;
color:white;
border-collapse:collapse;
border:0px solid #8D549B;
}

.daysofweek {
background-color:#C78FB9;
font:bold 9px arial;
color:#000000;
border-collapse:collapse;
border:0px solid #8D549B;
}

.days {
font-size: 9px;
font-family:arial;
color:black;
background-color: #FADBF2;
padding: 1px;
border-collapse:collapse;
border:0px solid #8D549B;
}

.days #today{
font-weight: bold;
color: #cc0000;
border-collapse:collapse;
border:0px solid #8D549B;
}

</style>


<script type="text/javascript" src="basiccalendar.js">
/***********************************************
* Basic Calendar-By Brian Gosselin at http://scriptasylum.com/bgaudiodr/
* Script featured on Dynamic Drive (http://www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>

</head>
<body bgcolor="#FFFFFF" leftmargin="5" topmargin="0" marginwidth="0" marginheight="0" oncontextmenu="return false">
<!-- ImageReady Slices (home.psd) -->
<div style="position:absolute; left:0; top:64">
<table>

<td width="140" align="center" valign="top">
<font size="1">eCalender</font>
<script type="text/javascript">
var todaydate=new Date()
var curmonth=todaydate.getMonth()+1 //get current month (1-12)
var curyear=todaydate.getFullYear() //get current year
document.write(buildCal(curmonth ,curyear, "main", "month", "daysofweek", "days", 1));
</script>
</td>
</table>

<table width="130" align="center" border="0" bgcolor="#FDC2D6">

<tr>
<td class="events" width="20" align="center">1</td>
<td class="events" align="left">April Fools Day</td>
</tr>

<tr>
<td class="events" width="20" align="center">4</td>
<td class="events" align="left">Ching Ming Festival</td>
</tr>

<tr>
<td class="events" width="20" align="center" valign="top">8</td>
<td class="events" align="left">Birthday of Sultan Johor</td>
</tr>

<tr>
<td class="events" width="20" align="center">9</td>
<td class="events" align="left">Good Friday</td>
</tr>

<tr>
<td class="events" width="20" align="center">11</td>
<td class="events" align="left">Easter Sunday</td>
</tr>

<tr>
<td class="events" width="20" align="center" valign="top">19</td>
<td class="events" align="left">Birthday of Sultan Perak</td>
</tr>

<tr>
<td class="events" width="20" align="center">22</td>
<td class="events" align="left">Earth Day</td>
</tr>

<tr>
<td class="events" width="20" align="center">25</td>
<td class="events" align="left">Secretary Day</td>
</tr>
</table>

</body>
</html>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 28 2004
Added on Apr 30 2004
1 comment
479 views