in reply to (jeffa) Re: HTML calendar w/dates = links
in thread HTML calendar w/dates = links

Well, yes, this is a problem. I've tried mucking around with blink's hash idea, but I can't get the program to:

- create a new date/link each time a new dated file is found
- create a new calendar each time a new month is encountered

  • Comment on Re: (jeffa) Re: HTML calendar w/dates = links

Replies are listed 'Best First'.
(jeffa) 3Re: HTML calendar w/dates = links
by jeffa (Bishop) on Aug 13, 2002 at 15:37 UTC
    Piece of cake, but you might want to read up on perlman:perldsc first. This example also takes care of new years too:
    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

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)