& /Elements/Header &>
close window
<%$months[$DisplayedMonth]%> <%$DisplayedYear%>
% foreach my $wday (@weekdays) {
<%$wday%> |
% }
% foreach my $week (@cal) {
% foreach my $day (@{$week}) {
% if ($day) {
% my $datestr = sprintf('%04d-%02d-%02d', $DisplayedYear, $DisplayedMonth+1, $day);
<%$day%>
% }
|
% } #foreach $day
% } # foreach $week
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);
%init>
<%args>
$field => 'none'
$DisplayedMonth => undef
$DisplayedYear => undef
%args>