Events Diary

Many websites these days feature an events diary. While they are a wonderful feature allowing people to see what the group gets up to, they also have a major problem - they need to be kept up to date.

The following script was produced for the old Asbourne Methodist Church to allow them to display their events diary on their website with little maintainance, the working demo can be found here.

The script uses an Array of records - one record for each entry - to store the information and then parses the array and displays all the records where the date is greater than or equal to the current date.

Therefore, to add the fifth entry into the diary for a Team Meeting taking place at 10:30 on the 17th of February 2002, we would have the following entry :

eventDiary[4] = new eventInfo("17","02","2002","10:30","Team Meeting");

To display the events diary on your page, you simply need to add the following two lines to your HTML page. The first line needs to be part of the <head> of your document, this is the line that links your HTML page to the Javascript file and must contain the path to the Javascript file. The second additional line is the line that calls the display routine in the Javascript function. Therefore a sample HTML page would be :

<html>
<head>
<script language="javascript" src="diary.js"></script>
</head>
<body>
This is the body<p>
<script language="javascript">display_diary()</script>
</body>
</html>

The source code for the events diary can be found here.

If you do have any comments on it, then please let me know. If you do use it, please also let me know.

Website Designed by Adservio Consulting Valid HTML 4.01 Strict    Valid CSS!    Level A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0