]> git.donarmstrong.com Git - deb_pkgs/libhtml-calendarmonth-perl.git/blobdiff - lib/HTML/CalendarMonth.pm
Merge tag 'upstream/2.04'
[deb_pkgs/libhtml-calendarmonth-perl.git] / lib / HTML / CalendarMonth.pm
index 6014d60488d141c60aaa807697f013878006cf27..20cb8ea02260e7e51959205595cfce9fff8086c0 100644 (file)
@@ -1,6 +1,6 @@
 package HTML::CalendarMonth;
 {
-  $HTML::CalendarMonth::VERSION = '1.26';
+  $HTML::CalendarMonth::VERSION = '2.04';
 }
 
 use strict;
@@ -51,7 +51,6 @@ my %Calmonth_Attrs = (
   _ctoih    => {},
   _caltool  => undef,
   _weeknums => undef,
-  _today    => undef,
 
   dow1st   => undef,
   lastday  => undef,
@@ -596,7 +595,7 @@ sub first_week_row { FWR };
 
 sub past_days {
   my $self  = shift;
-  my $today = $self->_today;
+  my $today = $self->today;
   if ($today < 0) {
     return $self->days;
   }
@@ -608,7 +607,7 @@ sub past_days {
 
 sub future_days {
   my $self  = shift;
-  my $today = $self->_today;
+  my $today = $self->today;
   if ($today < 0) {
     return;
   }
@@ -907,8 +906,7 @@ sub new {
 
   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) {
@@ -971,14 +969,10 @@ HTML::CalendarMonth - Generate and manipulate HTML calendar months
  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);
@@ -1007,7 +1001,7 @@ E<gt>item(2010)> would return the cell representing the year. Since
 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>
@@ -1086,11 +1080,12 @@ Specifies whether to display the week-of-year numbering. Default 0.
 =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
 
@@ -1122,11 +1117,11 @@ is determined based on the locale.
 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
 
@@ -1135,9 +1130,9 @@ default. The notion of 'today' is taken either from the system clock
 (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
 
@@ -1393,7 +1388,7 @@ Matthew P. Sisk, E<lt>F<sisk@mojotoad.com>E<gt>
 
 =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.