X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=1.26%2Flib%2FHTML%2FCalendarMonth%2FDateTool%2FCal.pm;fp=1.26%2Flib%2FHTML%2FCalendarMonth%2FDateTool%2FCal.pm;h=0000000000000000000000000000000000000000;hb=ed44be48bb467d82127717d1ae2d11890aaf329b;hp=e416528bc178b51daf9f943e1c783263252b71a4;hpb=982e2bb08f00d800e2cd9fb65b108231719c8a65;p=deb_pkgs%2Flibhtml-calendarmonth-perl.git diff --git a/1.26/lib/HTML/CalendarMonth/DateTool/Cal.pm b/1.26/lib/HTML/CalendarMonth/DateTool/Cal.pm deleted file mode 100644 index e416528..0000000 --- a/1.26/lib/HTML/CalendarMonth/DateTool/Cal.pm +++ /dev/null @@ -1,37 +0,0 @@ -package HTML::CalendarMonth::DateTool::Cal; -{ - $HTML::CalendarMonth::DateTool::Cal::VERSION = '1.26'; -} - -# Interface to unix 'cal' command - -use strict; -use warnings; -use Carp; - -use base qw( HTML::CalendarMonth::DateTool ); - -sub dow1st_and_lastday { - my($self, $month, $year) = @_; - $month ||= $self->month; - $year ||= $self->year; - my $cmd = $self->_cal_cmd or croak "cal command not found\n"; - - my @cal = grep(!/^\s*$/,`$cmd $month $year`); - chomp @cal; - my @days = grep(/\d+/,split(/\s+/,$cal[2])); - my $dow1st = 6 - $#days; - my($lastday) = $cal[$#cal] =~ /(\d+)\s*$/; - # With dow1st and lastday, one builds a calendar sequentially. - # Historically, in particular Sep 1752, days have been skipped. Here's - # the chance to catch that. - $self->_skips(undef); - if ($month == 9 && $year == 1752) { - my %skips; - grep(++$skips{$_}, 3 .. 13); - $self->_skips(\%skips); - } - ($dow1st, $lastday); -} - -1;