Hi,
I'm really struggling with this
It seems there are none (at least, that I can find) decent Perl modules for making a table based calendar.
At the moment, I have bodged some stuff together -;
However, this doesn't take into consideration the <td></td> data for blank spots (i.e when the date doesn't start on a monday).
Has anyone seen any good perl modules / good code for making a box type calendar? Like you get with Date::Calc::Calendar(yyyy,mm) , but in a table (it needs to be shown on a HTML page, so having just a plain test one isn't any good to me
TIA - I've been racking my brain over this for a good 4 days now, and the above code is about as close as I've got
Cheers
I'm really struggling with this
It seems there are none (at least, that I can find) decent Perl modules for making a table based calendar.
At the moment, I have bodged some stuff together -;
Code:
#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
print "Content-Type: text/html \n\n";
use Date::Calc qw(
Days_in_Year
Days_in_Month
Calendar
);
my $cal = Date::Calc::Calendar(2007,8);
print $cal;
# $cal =~ s| (\d+)|<a href="$1">$1</a>|sig;
my @tmp = split /\n/, $cal;
# $tmp[3];
my $back;
for (my $i = 3; $i <= 7; $i++) {
my $show = $tmp[$i];
$show =~ s| (\d+)|<td width="25" align="center"><a href="$1">$1</a></td>|sig;
$back .= "<tr>" .$show . "</tr>\n";
}
print qq|<table border="1" style="border-collapse: collapse">
<tr>
<td width="25" align="center"><b>Sun</b></td>
<td width="25" align="center"><b>Mon</b></td>
<td width="25" align="center"><b>Tue</b></td>
<td width="25" align="center"><b>Wed</b></td>
<td width="25" align="center"><b>Thur</b></td>
<td width="25" align="center"><b>Fri </b> </td>
<td width="25" align="center"><b>Sat</b></td>
</tr>
$back
</table>|;
However, this doesn't take into consideration the <td></td> data for blank spots (i.e when the date doesn't start on a monday).
Has anyone seen any good perl modules / good code for making a box type calendar? Like you get with Date::Calc::Calendar(yyyy,mm) , but in a table (it needs to be shown on a HTML page, so having just a plain test one isn't any good to me
TIA - I've been racking my brain over this for a good 4 days now, and the above code is about as close as I've got
Cheers