#!/usr/bin/perl use Date::Calc qw(:all); our @dates = qw(2004-09-01 2004-09-05 2004-09-09 2004-09-19 2004-09-20 2004-09-21 2004-09-22 ); print "Content-type: text/html\n\n"; print_calendar("09", "2004"); sub print_calendar { # $month is the two-digit number for the month, January being 01 and December being 12, etc. # $year is the full four-digit representation for the year, ie. 2001 my($month, $year) = @_; my @table = ("S", "M", "T", "W", "T", "F", "S"); my $start_day = Day_of_Week($year, $month, 1); my $end_day = Days_in_Month($year, $month); my $bgcolor; $start_day = $start_day % 7; for($i = 0; $i < $start_day; $i++) { push(@table, ' '); } for($i = 1; $i <= $end_day; $i++) { push(@table, $i); } for($i = 0; $i < (35 - ($end_day + $start_day)); $i++) { push(@table, ' '); } print "
"; print "" . Month_to_Text($month) . " $year | ||||||
$day | "; } else { print "$day | "; } if($count %7 == 6) { print "