<& /Elements/Header &> close window

% foreach my $wday (@weekdays) { % } % foreach my $week (@cal) { % foreach my $day (@{$week}) { % } #foreach $day % } # foreach $week
<%$months[$DisplayedMonth]%> <%$DisplayedYear%>
<%$wday%>
% if ($day) { % my $datestr = sprintf('%04d-%02d-%02d', $DisplayedYear, $DisplayedMonth+1, $day);
<%$day%>
% }
Previous   Next
<%init> use Calendar::Simple; my @today = localtime(time()); my @weekdays = (loc('Sun'), loc('Mon'), loc('Tue'), loc('Wed'), loc('Thu'), loc('Fri'), loc('Sat')); my @months = (loc('January'), loc('February'), loc('March'), loc('April'), loc('May'), loc('June'), loc('July'), loc('August'), loc('September'), loc('October'), loc('November'), loc('December')); unless ($DisplayedYear) { $DisplayedMonth = $today[4]; $DisplayedYear = ($today[5] + 1900); } my ($prev_year, $next_year, $prev_month, $next_month); $prev_month = $next_month = $DisplayedMonth; $prev_year = $next_year = $DisplayedYear; $next_month++; $prev_month--; if ($DisplayedMonth == 11) { $next_year++; $next_month = 0; } elsif ($DisplayedMonth == 0) { $prev_month = 11; $prev_year--; } my @cal = calendar($DisplayedMonth+1, $DisplayedYear); <%args> $field => 'none' $DisplayedMonth => undef $DisplayedYear => undef