|No such thing as a small change|
HTML::CalendarMonthSimple cookbook recipeby boo_radley (Parson)
|on Oct 23, 2001 at 20:51 UTC||Need Help??|
ProblemYou want to display data online in a monthly view.
SolutionMake use of HTML::CalendarMonthSimple to provide a programmatic interface to the contents of an HTML calendar month.
DiscussionThis short example provides the barest methods for inputting data into an HTML::CalendarMonthSimple object, and the displaying that calendar.
The new method takes 2 optional arguments, year and month. If either is missing, the current month or year will be used. This can be useful if you want a calendar of the current month in a previous year.
Example : my $cal = new HTML::CalendarMonthSimple ('year'=>1990); will make a calendar for October 1990.
content is added to each day via the setcontent and addcontent methods; setcontent replaces any existing data, and addcontent appends to the day's data.
Example : $cal->setcontent(31,"Halloween!"); puts "Halloween" into the 31st day of the calendar.
In addition to the methods listed above, there are a large host of methods which control the layout & presentation of the calendar; colors, fonts and html attributes can be configured easily, and calendar layout can be manipulated as well.
update I've patched the source code to prevent the warnings from occuring and as a side effect, this will emit smaller html. I've contacted the module's owner about the patches.
update (20Nov01) The patches I submitted have been integrated into the module, so it should be warning safe now.