Bugzilla – Attachment 8083 Details for
Bug 7477
Duplicate calendar
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7477 Followup Fix perlcritic issues
0001-Bug-7477-Followup-Fix-perlcritic-issues.patch (text/plain), 3.00 KB, created by
Jonathan Druart
on 2012-03-08 11:44:46 UTC
(
hide
)
Description:
Bug 7477 Followup Fix perlcritic issues
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2012-03-08 11:44:46 UTC
Size:
3.00 KB
patch
obsolete
>From b485b9dd6528fc4d5e7786217c91d8d9a9c6ec58 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 8 Mar 2012 12:41:13 +0100 >Subject: [PATCH 1/1] Bug 7477: Followup: Fix perlcritic issues > >--- > C4/Calendar.pm | 51 ++++++++++----------------------------------------- > 1 files changed, 10 insertions(+), 41 deletions(-) > >diff --git a/C4/Calendar.pm b/C4/Calendar.pm >index 8ad363f..a9d39dc 100644 >--- a/C4/Calendar.pm >+++ b/C4/Calendar.pm >@@ -582,37 +582,6 @@ sub copy_to_branch { > return 1; > } > >-=head2 daysBetween >- >- my $daysBetween = $calendar->daysBetween($startdate, $enddate) >- >-C<$startdate> and C<$enddate> are C4::Dates objects that define the interval. >- >-Returns the number of non-holiday days in the interval. >-useDaysMode syspref has no effect here. >-=cut >- >-sub daysBetween ($$$) { >- my $self = shift or return undef; >- my $startdate = shift or return undef; >- my $enddate = shift or return undef; >- my ($yearFrom,$monthFrom,$dayFrom) = split("-",$startdate->output('iso')); >- my ($yearTo, $monthTo, $dayTo ) = split("-", $enddate->output('iso')); >- if (Date_to_Days($yearFrom,$monthFrom,$dayFrom) > Date_to_Days($yearTo,$monthTo,$dayTo)) { >- return 0; >- # we don't go backwards ( FIXME - handle this error better ) >- } >- my $count = 0; >- while (1) { >- ($yearFrom != $yearTo or $monthFrom != $monthTo or $dayFrom != $dayTo) or last; # if they all match, it's the last day >- unless ($self->isHoliday($dayFrom, $monthFrom, $yearFrom)) { >- $count++; >- } >- ($yearFrom, $monthFrom, $dayFrom) = &Date::Calc::Add_Delta_Days($yearFrom, $monthFrom, $dayFrom, 1); >- } >- return($count); >-} >- > =head2 addDate > > my ($day, $month, $year) = $calendar->addDate($date, $offset) >@@ -660,16 +629,16 @@ Returns the number of non-holiday days in the interval. > useDaysMode syspref has no effect here. > =cut > >-sub daysBetween ($$$) { >- my $self = shift or return undef; >- my $startdate = shift or return undef; >- my $enddate = shift or return undef; >- my ($yearFrom,$monthFrom,$dayFrom) = split("-",$startdate->output('iso')); >- my ($yearTo, $monthTo, $dayTo ) = split("-", $enddate->output('iso')); >- if (Date_to_Days($yearFrom,$monthFrom,$dayFrom) > Date_to_Days($yearTo,$monthTo,$dayTo)) { >- return 0; >- # we don't go backwards ( FIXME - handle this error better ) >- } >+sub daysBetween { >+ my $self = shift or return; >+ my $startdate = shift or return; >+ my $enddate = shift or return; >+ my ($yearFrom,$monthFrom,$dayFrom) = split("-",$startdate->output('iso')); >+ my ($yearTo, $monthTo, $dayTo ) = split("-", $enddate->output('iso')); >+ if (Date_to_Days($yearFrom,$monthFrom,$dayFrom) > Date_to_Days($yearTo,$monthTo,$dayTo)) { >+ return 0; >+ # we don't go backwards ( FIXME - handle this error better ) >+ } > my $count = 0; > while (1) { > ($yearFrom != $yearTo or $monthFrom != $monthTo or $dayFrom != $dayTo) or last; # if they all match, it's the last day >-- >1.7.7.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7477
:
7401
|
7494
|
7495
|
7520
|
7521
|
7547
|
7626
|
7627
|
8013
|
8083
|
8105