HTML::Calendar::Monthly - A very simple HTML calendar
use HTML::Calendar::Monthly; my $cal = HTML::Calendar::Monthly->new; # This month, this year $cal = HTML::Calendar::Monthly->new({ 'month' => $month }); # This year $cal = HTML::Calendar::Monthly->new({ 'month' => $month, 'year' => $year}); my $month = $cal->month; my $year = $cal->year; # Add a link for a day. $cal->add_link( $day, $link ); # Get HTML representation. my $html = $cal->calendar_month;
This is a very simple module which will make an HTML representation of a given month. You can add links to individual days.
Yes, the inspiration for this came out of me looking at HTML::Calendar::Simple, and thinking 'Hmmm. A bit too complicated for what I want. I know, I will write a simplified version.' So I did.
my $cal = HTML::Calendar::Monthly->new; my $cal = HTML::Calendar::Monthly->new({ 'month' => $month }); my $cal = HTML::Calendar::Monthly->new({ 'month' => $month, 'year' => $year });
This will make a new HTML::Calendar::Monthly object.
my $month = $cal->month;
This will return the numerical value of the month.
my $month = $cal->month_name;
This will return the name of the month.
my $year = $cal->year;
This will return the four-digit year of the calendar
$cal->add_link( $day, $link ); # puts an href on the day
my $html = $cal->calendar_month;
This will return an html string of the calendar month.
Johan Vromans <jvromans@squirrel.nl>
Parts of this module are copied from HTML::Calendar::Simple, written by Stray Toaster <coder@stray-toaster.co.uk>.
To install HTML::Calendar::Monthly, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTML::Calendar::Monthly
CPAN shell
perl -MCPAN -e shell install HTML::Calendar::Monthly
For more information on module installation, please visit the detailed CPAN module installation guide.