# Calendar weeks do not have to start on Sunday. Arbitrary days
# may be specified as the first day of the week. For coding
# purposes, 1..7 correspond to Sun..Sat. Week of the year
# numbers may be added as well, along with arbitrary aliasing
# of any calendar elements.
# Translations to German
%translation = (
# Month names
January => 'Januar',
February => 'Februar',
March => 'März',
April => 'April',
May => 'Mai',
June => 'Juni',
July => 'Juli',
August => 'August',
September => 'September',
October => 'Oktober',
November => 'November',
December => 'Dezember',
# Day abreviations.
# (are these correct?)
Su => 'So', # Sunday => Sonntag
M => 'Mo', # Monday => Montag
Tu => 'Di', # Tuesday => Dienstag
W => 'Mi', # Wednesday => Mittwoch
Th => 'Do', # Thursday => Donnerstag
F => 'Fr', # Friday => Freitag
Sa => 'Sa', # Saturday => Samstag
);
@cals = (
new HTML::CalendarMonth ( month => 3),
new HTML::CalendarMonth ( month => 3, week_begin => 2 ),
new HTML::CalendarMonth ( month => 3,
week_begin => 2,
head_week => 1 ),
new HTML::CalendarMonth ( month => 3,
week_begin => 2,
head_week => 1,
alias => \%translation,
),
);
# Embolden headers
foreach (@cals) {
$_->item($_->month,$_->year)->wrap_content(font({size => '+2'}));
$_->item($_->dayheaders)->wrap_content(font({size => '-1'}));
}
# Illustrate week number headers
foreach (@cals[2,3]) {
$_->item_week_nums->wrap_content(font({'size' => '-1'}));
$_->item_week_nums->attr('bgcolor' => 'cyan');
}
# Generate container table
$t = new HTML::ElementTable ( maxrow => 1, maxcol => 3 );
$t->row(0)->attr(valign => 'bottom');
$t->row(1)->attr(align => 'middle');
$t->cell(1,0)->push_content(em("Default"));
$t->cell(1,1)->push_content(em("Monday 1st", br, "Day Of Week"));
$t->cell(1,2)->push_content(em("Monday 1st DOW", br,
"plus week of year count"));
$t->cell(1,3)->push_content(em("Deutsch aliased"));
# Populate container table
foreach (0..$#cals) {
$t->cell(0,$_)->push_content($cals[$_]);
}
print $t->as_HTML; |