Not exactly sure if this is what you are looking for... I basicly took my old code from Solution for Date::Calc to HTML::CalendarMonth and pasted in the new code that you wrote.
#!/usr/bin/perl use strict; use warnings; use Date::Calc qw(:all); use CGI qw(:standard); use HTML::AsSubs; use HTML::Element; use HTML::CalendarMonth; # @dates has already been sorted my @dates = ( 730000, 731158, 731159, 731160, 731161, 731178, 735000 ) +; my @cals; print header(), start_html(-title => "Calendars"); while ( defined $dates[0] ) { my $days = $dates[0]; my ( $year, $month, $day ) = Add_Delta_Days( 1, 1, 1, $days - 1 ); my $new_c = new HTML::CalendarMonth ( year => $year, month => $month + ); push ( @cals, $new_c ); @dates = CreateCal( $year, $month, @dates ); } # Embolden headers foreach my $cal ( @cals ) { $cal->item( $cal->month, $cal->year )->wrap_content( font({ size => + '2' }) ); $cal->item( $cal->dayheaders )->wrap_content( font({ size => '1' }) + ); $cal->item( 15, 16, 17 )->wrap_content( font({ size => 4, color => +'red' }) ); } # Generate container table my $t = new HTML::ElementTable ( maxrow => 1, maxcol => 4 ); # Populate container table for my $calnum ( 0 .. $#cals ) { $t->cell( 0, $calnum )->push_content( $cals[$calnum] ); } print $t->as_HTML; print end_html(); exit(0); sub CreateCal { my ( $cyear, $cmonth, @dates ) = @_; my ( @days, @temp ); foreach my $days ( @dates ) { my ( $year, $month, $day ) = Add_Delta_Days( 1, 1, 1, $days - 1 ); if ( $year == $cyear && $month == $cmonth ) { push ( @days, $day ); } else { push ( @temp, $days ); } } return @temp; }
added It does put the calendars into a container table.
In reply to Re: Generating a container table in HTML::CalendarMonth
by Mr. Muskrat
in thread Generating a container table in HTML::CalendarMonth
by jonnyfolk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |