]> git.donarmstrong.com Git - deb_pkgs/libhtml-calendarmonth-perl.git/blobdiff - lib/HTML/CalendarMonth.pm
upgrade to 1.26; fix lintian issues
[deb_pkgs/libhtml-calendarmonth-perl.git] / lib / HTML / CalendarMonth.pm
index 5ca73498c7e135449d994c17e108329e73fd9ffb..6014d60488d141c60aaa807697f013878006cf27 100644 (file)
@@ -1,14 +1,12 @@
 package HTML::CalendarMonth;
-BEGIN {
-  $HTML::CalendarMonth::VERSION = '1.25';
+{
+  $HTML::CalendarMonth::VERSION = '1.26';
 }
 
 use strict;
 use warnings;
 use Carp;
 
-BEGIN { $HTML::CalendarMonth::VERSION = 1.25 }
-
 use HTML::ElementTable 1.18;
 use HTML::CalendarMonth::Locale;
 use HTML::CalendarMonth::DateTool;
@@ -241,17 +239,15 @@ sub _gencal {
   $self->item($self->year)->replace_content($self->item_alias($self->year));
 
   if ($self->_head_my) {
-    if ($self->head_m) {
-      $self->item($self->month)->attr('colspan',$width - $self->year_span);
+    if ($self->head_m && $self->head_y) {
+      $self->item($self->year) ->attr('colspan', $self->year_span);
+      $self->item($self->month)->attr('colspan', $width - $self->year_span);
     }
-    else {
+    elsif ($self->head_y) {
       $self->item($self->month)->mask(1);
       $self->item($self->year)->attr('colspan', $width);
     }
-    if ($self->head_y) {
-      $self->item($self->year)->attr('colspan',$self->year_span);
-    }
-    else {
+    elsif ($self->head_m) {
       $self->item($self->year)->mask(1);
       $self->item($self->month)->attr('colspan', $width);
     }
@@ -307,11 +303,14 @@ sub _gencal {
 
   # css classes
   if ($self->enable_css) {
-    $self                             ->push_attr(class => 'hcm-table'     );
-    $self->item_row($self->dayheaders)->push_attr(class => 'hcm-day-head'  );
-    $self->item    ($self->year)      ->push_attr(class => 'hcm-year-head' );
-    $self->item    ($self->month)     ->push_attr(class => 'hcm-month-head');
-    $self->item    ($self->week_nums) ->push_attr(class => 'hcm-week-head' )
+    $self->push_attr(class => 'hcm-table');
+    $self->item_row($self->dayheaders)->push_attr(class => 'hcm-day-head')
+      if $self->head_dow;
+    $self->item($self->year)->push_attr(class => 'hcm-year-head')
+      if $self->head_y;
+    $self->item($self->month)->push_attr(class => 'hcm-month-head')
+      if $self->head_m;
+    $self->item($self->week_nums) ->push_attr(class => 'hcm-week-head')
       if $self->head_week;
   }
 
@@ -1008,7 +1007,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
-explicitely referencing the year: C<$c-E<gt>item($c- E<gt>year())>.
+explicitly 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>
@@ -1080,6 +1079,10 @@ Specifies whether to display the year header. Default 1.
 
 Specifies whether to display days of the week header. Default 1.
 
+=item head_week
+
+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
@@ -1108,10 +1111,6 @@ custom label you prefer. Lookups, such as C<day('Sun')>, will still use
 the locale string, but when the calendar is rendered the aliased value
 will appear.
 
-=item head_week
-
-Specifies whether to display the week-of-year numbering. Default 0.
-
 =item week_begin
 
 Specify first day of the week, which can be 1..7, starting with Sunday.