This is version . It is not the current version, and thus it cannot be edited.
[Back to current version]   [Restore this version]

The CalendarListPlugin provides a view into a schedule of events. (x past days, y futures days)

Using this plugin you can have a calendar of the the year's events, recording them as you discover them, and the plugin will display a list of the most recent and upcoming events.

This plugin started because my girlfriend and I were sharing a calendar on the wiki with events just stuffed into a table. We used InsertPage to show the schedule at the top of our homepage. The table started growing. Soon it was taking up all the space on the homepage because of events that were 3 or more weeks away. Suddenly a light went and I said, "Gee, wouldn't it be nice to show only the next 7 days worth of events but still have this big list. Thus the plugin was born - well, the idea anyway.

Here are two screen shots. The first shows the page with the complete schedule. The second shows a wiki page called 'HomePage' with a small section of the schedule displayed as a list.

The schedule pages uses wiki markup to build the schedule list. Currently the date format must be precise - exactly the date, or exactly the date, a space, and the time with leading zero if the hour is under 10. I'm working on making the formatting more flexible and the date/time entry lest strict. I'd also like to be able to show unscheduled events.

There are a lot of parameters, but most of them are optional. The line below shows the minimum you need. Remember you can add the com.hurlbert.jspwiki.plugin to your file to shorten the line further.

CalendarListPlugin syntax:#

[{INSERT com.hurlbert.jspwiki.plugin.CalendarList listpagename='MyEvents'}]


listpagename (mandatory)
This is the name of the wiki page containing the schedule events. The must be in a table, as described below.
format (optional)
Default: list
This defines the output format. Valid values are LIST or WEEKLY. (More may be added later.)
futuredays (optional)
Default: 3
This is the number of days of events to show on the output. futuredays=21 will show 3 weeks worth of events.
pastdays (optional)
Default: 1
This is the number of past days events. pastdays=7 will show a weeks worth of past events.
hotcolor (optional)
Default: red
If the events are within 'hotdays' of today, they will show up as this color.
warmcolor (optional)
Default: brown
If the events are within 'warmdays' of today, they will show up as this color.
coldcolor (optional)
Default: black
If the events are within 'colddays' of today, they will show up as this color.
hotdays (optional)
Default: 1
The number of days worth of events to show with the hotcolor.
warmdays (optional)
Default: 7
The number of days worth of events to show with the warmcolor.
colddays (optional)
Default: 14
The number of days worth of events to show with the coldcolor.
pastcolor (optional)
Default: #999999
Events that are in the past will show as pastcolor.
listcolor (optional)
Default: lightgrey
Events that are in the future and not covered by the other colors will show as listcolor.
todaybgcolor (optional)
Default: lightblue
'Today' has todaybgcolor as the background color. This allows today to be seen easily.
headerbgcolor (optional)
Default: #FOFOFO
The header is the "Mon Tue Wed..." part at the top of the weekly calendar list. This color is used for the background of the header.
daybgcolor (optional)
Default: #FOFOFO
Each day will have daybgcolor as the background color, except for today. That will have todaybgcolor.
boldtoday (optional)
Default: true
If this is true, the event text for today will be bold.

Format of the schedule page (not the output page). #

The schedule format is pretty strict right now. Build a page anyway you like, lines with the following format will be picked up and put in the schedule.
|02/01/04 03:00 PM|Superbowl
|02/02/04 08:00 PM|Antiques Roadshow SF
|02/09/04 08:00 PM|Antiques Roadshow SF
|02/29/04 05:00 PM|[The Oscars - 76th Annual|]
|03/09/04 10:00 PM|The Shield, Season 3 premier

Using CalendarListPlugin#

Display a weekly calendar, with a header like this screenshot (Generated from these events)

%%( font-family: Arial; font-size: 60%; )
[{INSERT com.hurlbert.jspwiki.plugin.CalendarList listpagename='SVSchedule' 
pastdays='7' futuredays='15' hotdays=1 warmdays=2 colddays=7 listcolor=BLUE 
hotcolor=darkgreen warmcolor=maroon coldcolor=blue format=WEEKLY 

Display a simlpe list with the default coloring

[{INSERT com.hurlbert.jspwiki.plugin.CalendarList listpagename='SVSchedule'}]

Bugs, unfinished items.#

  • The date parsing is very strict. It currently generates a PluginException if the format is wrong. It should ignore or warn.
  • Items with no time show up as starting at 12:00 AM. I'd like to just have them sort to the top of the day and have no time, but until I can program someway to tell them apart from something that does start at 12:00 AM I'll leave this alone.

Some possible enhancements (feel free to add others)#

  • More formats.
  • Move the defaults to the file.
  • Add categories to the events.

Enjoy - Scott Hurlbert

PS - Now that all that is out of the way, let me add a disclaimer. I have no freaking idea how to code like this! I seem to have a hard time making HTML generation clean. The code always seems to be getting in it's own way. So please, take this program with a grain of salt. I plan on cleaning it up here and there.

If you have any suggestions on how to write such a plugin with a better seperation of event handling vs HTML generation, please share. Thanks, Scott

Add new attachment

Only authorized users are allowed to upload new attachments.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
CalendarListPlugin 11.6 kB 1 06-Jul-2006 14:13
CalendarListPlugin.JPG 75.2 kB 1 03-Feb-2004 12:42
zip 29.8 kB 2 11-Oct-2011 19:53 Jerry Andrews version 3
SVSchedule.JPG 105.6 kB 1 03-Feb-2004 12:42
calendarplugin1.jpg 100.5 kB 1 08-Jun-2009 18:48
calendarplugin2.jpg 66.1 kB 1 08-Jun-2009 18:48
« This particular version was published on 04-Feb-2004 11:18 by