Bugzilla – Attachment 13945 Details for
Bug 9211
days_between wrong behaviour
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 9211 - days_between wrong behaviour
Bug-9211---daysbetween-wrong-behaviour.patch (text/plain), 1.31 KB, created by
Kyle M Hall (khall)
on 2012-12-07 17:09:04 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 9211 - days_between wrong behaviour
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2012-12-07 17:09:04 UTC
Size:
1.31 KB
patch
obsolete
>From 396cf0b8d8f9d382e12488bf552ec6e407f24a80 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Tue, 4 Dec 2012 15:32:28 -0300 >Subject: [PATCH] Bug 9211 - days_between wrong behaviour >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >As noted in comments #15, #16 and #17 of bug 8486, and its API, Koha::Calendar->days_between >should always returns a positive number irrespective of the relative order of the parameters. >This is still an open bug, which arised when rewriting the Calendar.t file (Bug 9209). > >Regards >To+ > >Sponsored-by: Universidad Nacional de Córdoba >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >http://bugs.koha-community.org/show_bug.cgi?id=9221 >--- > Koha/Calendar.pm | 7 +++++++ > 1 files changed, 7 insertions(+), 0 deletions(-) > >diff --git a/Koha/Calendar.pm b/Koha/Calendar.pm >index 90069b6..3202035 100644 >--- a/Koha/Calendar.pm >+++ b/Koha/Calendar.pm >@@ -241,6 +241,13 @@ sub days_between { > my $start_dt = shift; > my $end_dt = shift; > >+ if ( $start_dt->compare($end_dt) > 0 ) { >+ # swap dates >+ my $int_dt = $end_dt; >+ $end_dt = $start_dt; >+ $start_dt = $int_dt; >+ } >+ > > # start and end should not be closed days > my $days = $start_dt->delta_days($end_dt)->delta_days; >-- >1.7.2.5
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 9211
:
13886
| 13945 |
13946
|
14400
|
14401
|
14402
|
14403