The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

NAME

HTML::Calendar::Monthly - A very simple HTML calendar

SYNOPSIS

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;

DESCRIPTION

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.

new

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.

month

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.

year

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

calendar_month

my $html = $cal->calendar_month;

This will return an html string of the calendar month.

AUTHOR

Johan Vromans <jvromans@squirrel.nl>

Parts of this module are copied from HTML::Calendar::Simple, written by Stray Toaster <coder@stray-toaster.co.uk>.