<& /Elements/Header, ShowBar => 0 &> %# From /Elements/Header
<&|/l&>Close window
% foreach my $wday (@weekdays) { % } % foreach my $week (@cal) { % foreach my $day (@{$week}) { % } #foreach $day % } # foreach $week
<% $months[$DisplayedMonth-1] %> <% $DisplayedYear %>
<%$wday%>
% if ($day) { % my $datestr = sprintf('%04d-%02d-%02d', $DisplayedYear, $DisplayedMonth, $day); <% $day %> % } else {   % }
% $m->abort(); <%init> use Calendar::Simple; my @today = localtime(time()); my @weekdays; push @weekdays, loc($_) for qw(Sun Mon Tue Wed Thu Fri Sat); my @months; push @months, loc($_) for qw(January February March April May June July August September October November December); unless ($DisplayedYear) { $DisplayedMonth = $today[4] + 1; $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 == 12) { $next_year++; $next_month = 1; } elsif ($DisplayedMonth == 1) { $prev_month = 12; $prev_year--; } my @cal = calendar($DisplayedMonth, $DisplayedYear); <%args> $field => 'none' $DisplayedMonth => undef $DisplayedYear => undef