NAME
Calendar::Generate - Rule based calendar generation.
SYNOPSIS
This is alpha code. API is subject to (and will) change. While it was
released with the hope that it might be useful, it was written to solve
a specific problem.
# The easy way.
use Calendar::Generate;
my $calendar = new Calendar::Generate;
print $calendar->generate( 2004, 12, 25 );
# The detailed way.
use Calendar::Generate;
my $calendar = new Calendar::Generate;
$calendar->rules( {
month_header => "
\n",
title_start => '',
title_end => " |
\n",
title_center => 1,
title_text => undef,
row_start => ' ',
row_end => "
\n",
space_start => ' ',
space_char => '',
space_end => ' | ',
highlight_start => ' ',
highlight_end => ' | ',
digit_start => ' ',
digit_end => ' | ',
dow_start => ' ',
dow_end => ' | ',
dow_length => 3,
month_footer => "
\n",
data_use => 0,
data_start => '',
data_end => '',
data_null => '',
data_place => 1
} );
print $calendar->generate( 2004, 12, 25 );
DESCRIPTION
Calendar::Generate creates a calendar formatted based on rules that you
provide.
Creating a new object
$calendar = new Calendar::Generate;
Setting rules
$calendar->rules( { param => value, ... } );
FORMATTING RULES
-month_header
Printed before the calendar.
-title_start
The left of the month title.
-title_end
The right of the month title.
-title_center
Define this to center the month title.
-row_start
For before every row in the calendar (excluding title).
-row_end
For the end of every row in the calendar (excuding title).
-space_start
Formatting start for a blank entry.
-space_char
Chracter to use for a blank space.
-space_end
Formatting for use at the end of a blank entry.
-highlight_start
Formatting for the start of a highlighted entry.
-highlight_end
... and the end of a highlighted entry.
-digit_start
Formatting used before the printing of the day number.
-digit_end
... and the end of the day number.
-dow_start
Formatting for the start of a day of the week.
-dow_end
... are you starting to see a pattern here?
-dow_length
The number of letters of the day of the week to print.
-month_footer
Printed at the end of the calendar.
-data_use
Determines if data associated with each date should be printed (0 =
no, 1 = yes/don't print nulls, 2 = yes/print nulls)
-data_null
The data to use for a day that has no associated data.
-data_start
Formatting for the start of a data item.
-data_end
... and the end.
-data_place
determines where data item should be placed (0 = before, 1 = after)
Printing output
Both of these return the formatted calendar.
$calendar->generate( 'Year', 'Month', 'Day' );
$calendar->calendar();
Generate actually builds the calendar so if you plan to use
get_calendar() for whatever reason, you need to have first called
generate()
PROVIDED RULESETS
$calendar->rules_cal();
This is a set of attributes which will make the output look like
that of cal(1). It is also currently the default set of attributes.
$calendar->rules_html();
This is a set of attributes which will make the output print well in
a table compliant web browser. It also works in the Lynx text
browser.
ACKNOWLEDGEMENTS
Emanuele Zeppieri - Errors in the POD examples.
AUTHOR
This module is based on code origionally written by Matthew Darwin and
the origional version is available at http://www.mdarwin.ca/perl
Currently the maintainer is Clint Moore
SEE ALSO
Date::DateCalc(3) cal(1)