in reply to HTML::CalendarMonth - printing a consistent (6) rows for days of the week

Give this a whirl:
my $c = HTML::CalendarMonth->new( year => 2003, month => 1, bgcolor => 'white', ); $c->maxrow($c->maxrow + 1); print $c->as_HTML;
This produces the calendar on the right below:

January2000
SuMTuWThFSa
            1
2345678
9101112131415
16171819202122
23242526272829
3031         
January2003
SuMTuWThFSa
      1234
567891011
12131415161718
19202122232425
262728293031 
             

You can compare $c->maxrow (or $c->last_row) for each calendar in question to decide whether to add the extra row or not. Note that once you add the extra row, $c->maxrow() and $c->last_row() will yield different results -- the former pertains to the HTML table, the latter pertains to the calendar data itself.

Cheers,
Matt

Replies are listed 'Best First'.
Re: Re: HTML::CalendarMonth - printing a consistent (6) rows for days of the week
by jonnyfolk (Vicar) on Dec 12, 2003 at 07:48 UTC
    My humble thanks, Oh Great One, I have been able to create the following lines to compare each calendar:
    my $result = $c->last_row; unless ($result == 7) { $c->maxrow($c->maxrow + 1); }
    I don't know if a proper programmer would have done it differently, but this works for me, and I am grateful for your help.