Code Comments
Programming Forum and web based access to our favorite programming groups.Hi, Can you recommend a good module for creating calendars with links for each day in html format? I have searched with CPAN after "calendar" and I found more modules, but I don't know which one would be the best. Have you used one that's good? Thanks. Teddy
Post Follow-up to this messageOn Sat, 26 Mar 2005 13:07:50 +0200, orasnita@fcc.ro (Octavian Rasnita)
wrote:
>Hi,
>
>Can you recommend a good module for creating calendars with links for each
>day in html format?
>
>I have searched with CPAN after "calendar" and I found more modules, but I
>don't know which one would be the best.
>
>Have you used one that's good?
#!/usr/bin/perl
use CGI qw(header);
use HTML::CalendarMonthSimple;
use strict;
my %cal;
while (<DATA> ) {
chomp;
my ($file,$yyyy,$mm,$dd) = /([^.]+)\.(\d{4})(\d\d)(\d\d)/;
push @{$cal{$yyyy}->{$mm}},{day => $dd, targ => $file};
}
print header;
for my $year (sort keys %cal) {
for my $mon (sort keys %{$cal{$year}}) {
my $cal = HTML::CalendarMonthSimple->new(
month => $mon,
year => $year,
);
for (sort @{$cal{$year}->{$mon}}) {
$cal->setdatehref(int($_->{day}), $_->{targ});
}
print $cal->as_HTML();
}
}
__DATA__
file5.20030227
file2.20020802
file1.20020801
file4.20021015
file3.20020803
__END__
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.