package HTML::CalendarMonth;
{
- $HTML::CalendarMonth::VERSION = '1.26';
+ $HTML::CalendarMonth::VERSION = '2.04';
}
use strict;
_ctoih => {},
_caltool => undef,
_weeknums => undef,
- _today => undef,
dow1st => undef,
lastday => undef,
sub past_days {
my $self = shift;
- my $today = $self->_today;
+ my $today = $self->today;
if ($today < 0) {
return $self->days;
}
sub future_days {
my $self = shift;
- my $today = $self->_today;
+ my $today = $self->today;
if ($today < 0) {
return;
}
my $dom_now = defined $attrs{today} ? $dt->_dom_now(delete $attrs{today})
: $dt->_dom_now;
- $self->_today($dom_now);
- $self->today($dom_now) if $dom_now > 0;
+ $self->today($dom_now);
my $alias = $attrs{alias} || {};
if ($self->full_days < 0) {
my $c2 = HTML::CalendarMonth->new(
month => 8,
year => 2010,
- locale => 'zu_ZA'
+ locale => 'zu-ZA'
);
print $c2->as_HTML;
- # Full locale support via DateTime::Locale
- $c3 = HTML::CalendarMonth->new( month => 8, year => 79, locale => 'fr' );
- print $c3->as_HTML
-
# HTML-Tree integration
my $tree = HTML::TreeBuilder->parse_file('cal.html');
$tree->find_by_attribute(class => 'hcm-calendar')->replace_with($c);
years and particular months change frequently, it is probably more
useful to take advantage of the C<month()> and C<year()> methods, which
return their respective values. The following is therefore the same as
-explicitly referencing the year: C<$c-E<gt>item($c- E<gt>year())>.
+explicitely referencing the year: C<$c-E<gt>item($c- E<gt>year())>.
Multiple cells of the calendar can be manipulated as if they were a
single element. For instance, C<$c-E<gt>item(15)-E<gt>attr(class =E<gt>
=item locale
Specifies the id of the locale in which to render the calendar. Default
-is 'en_US'. By default, this will also control determine which day is
+is 'en-US'. By default, this will also control determine which day is
considered to be the first day of the week. See
L<HTML::CalendarMonth::Locale> for more information. If for some reason
you prefer to use different labels than those provided by C<locale>, see
-the C<alias> attribute below.
+the C<alias> attribute below. NOTE: DateTime::Locale versions 0.92 and
+earlier use underscores rather than dashes, e.g. 'en_US'.
=item full_days
Set some handy CSS class attributes on elements, enabled by default.
Currently the classes are:
- hcm-table Set on the <lt>table<gt> tag of the calendar
- hcm-day-head Set on the day-of-week <lt>tr<gt> or <lt>td<gt> tags
- hcm-year-head Set on the <lt>td<gt> tag for the year
- hcm-month-head Set on the <lt>td<gt> tag for the month
- hcm-week-head Set on the <lt>td<gt> tags for the week-of-year
+ hcm-table Set on the E<lt>tableE<gt> tag of the calendar
+ hcm-day-head Set on the day-of-week E<lt>trE<gt> or E<lt>tdE<gt> tags
+ hcm-year-head Set on the E<lt>tdE<gt> tag for the year
+ hcm-month-head Set on the E<lt>tdE<gt> tag for the month
+ hcm-week-head Set on the E<lt>tdE<gt> tags for the week-of-year
=item semantic_css
(default) or from the 'today' parameter as provided to new(). Currently
these classes are:
- hcm-today Set on the <lt>td<gt> tag for today, if present
- hcm-past Set on the <lt>td<gt> tags for prior days, if present
- hcm-future Set on the <lt>td<gt> tags for subsequent days, if present
+ hcm-today Set on the E<lt>tdE<gt> tag for today, if present
+ hcm-past Set on the E<lt>tdE<gt> tags for prior days, if present
+ hcm-future Set on the E<lt>tdE<gt> tags for subsequent days, if present
=item today
=head1 COPYRIGHT
-Copyright (c) 1998-2010 Matthew P. Sisk. All rights reserved. All wrongs
+Copyright (c) 1998-2015 Matthew P. Sisk. All rights reserved. All wrongs
revenged. This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.