wiredfool

DrawCalendar

*** What it is

This is a drop in replacement for the main responder calendar script, using the same parameters, although some of them are ignored. It produces a calendar that looks like:


[ Last Year ] [ Last Month ] [ Last Week ] 8 9 10 11 12 13 14 15 16 17 18 19 20 [ Next Week ] [ Next Month ] [ Next Year ]

This sort of calendar is advantageous for lynx users, as the default tabeled calendar is about three pages long. This is also a more useful calendar just around the end of the month, as it shows a relative rather than an absolute time. It’s also useful when you want a low, sleek, and slightly less ordinary look.

*** How to call it.

Download it and put it in the macros table of a website.

The function header:
on drawCalendar(adrcalendar=nil, urlprefix=””, colwidth=32, rowheight=22, tableborder=0, bgcolor=nil, monthYearTemplate=” [ *** ] “, dayNameTemplate=” [ *** ] “, dayTemplate=”***”, curdate=clock.now ())

Of these parameters; colwidth, rowheight, tableborder and bgcolor are ignored, as they are specific to the table rendered version that the code evolved from. Day template adjusts the display of the individual days. The DayName template is used for the Last Week/Next Week links. The monthYearTemplate is used for the Next Month and Next Year links.

One typical function call snagged from my mailserver html:

{drawCalendar(mailserver.storage(folder,”[\”#indicies\”].date”), urlprefix:prefix+”bydate$”+folder+”.”)}

2 comments

2 Comments so far

  1. Commenter June 11th, 2001 9:11 am

    Can I use this macro on a Manila site? If so where do I put it and what parameters do I need to call it?

    Thanks.

  2. Commenter June 11th, 2001 10:19 am

    Can I use this macro on a Manila site? If so where do I put it and what parameters do I need to call it?

    Yes, you can use it in manila.

    Put it somewhere that is in scope; either the tools table or user.html.macros, or in a table where you call using the full address. (i.e. localMacros.drawCalendar). You’ll need to make it a legal macro in config.mainresponder.prefs.legalMacros. (there might be issues with adrCalendar, looking at it. hmmm. You may need a wrapper that finds the adrcalandar and the appropriate date to pass in. In that case, the wrapper would need to be the legal macro.)

    The two required parameters for it to do anything interesting are the address of the calendar and the current date. Anything else is just for formatting.

Leave a reply

You must be logged in to post a comment.