[open-ils-commits] [GIT] Evergreen ILS branch master updated. 04a101312b0a42d34108c8d78997a3960241363a

Evergreen Git git at git.evergreen-ils.org
Mon Jul 31 12:06:54 EDT 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  04a101312b0a42d34108c8d78997a3960241363a (commit)
      from  a7b434988ca95d66fdcb7141d4b8c6a42b60e449 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 04a101312b0a42d34108c8d78997a3960241363a
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Fri Jul 21 14:28:16 2017 -0400

    LP#1635737 Use new OpenSRF interval_to_seconds() context
    
    Use the optional context for interval_to_seconds() to account for the
    variable length of duration components.  For example, "1 day" may be
    shorter or longer than 24 hours during a time change event, "1 month"
    may be shorter or longer depending on which month it is currently, etc.
    
    Also, remove some timestamp munging, as that happens within
    interval_to_seconds() already.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
index 21b875d..65b6f04 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
@@ -2077,16 +2077,12 @@ sub apply_modified_due_date {
 sub create_due_date {
     my( $self, $duration, $date_ceiling, $force_date, $start_time ) = @_;
 
-    # if there is a raw time component (e.g. from postgres), 
-    # turn it into an interval that interval_to_seconds can parse
-    $duration =~ s/(\d{2}):(\d{2}):(\d{2})/$1 h $2 m $3 s/o;
-
     # for now, use the server timezone.  TODO: use workstation org timezone
     my $due_date = DateTime->now(time_zone => 'local');
     $due_date = DateTime::Format::ISO8601->new->parse_datetime(cleanse_ISO8601($start_time)) if $start_time;
 
     # add the circ duration
-    $due_date->add(seconds => OpenSRF::Utils->interval_to_seconds($duration));
+    $due_date->add(seconds => OpenSRF::Utils->interval_to_seconds($duration, $due_date));
 
     if($date_ceiling) {
         my $cdate = DateTime::Format::ISO8601->new->parse_datetime(cleanse_ISO8601($date_ceiling));
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/NonCat.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/NonCat.pm
index 26b85d2..3302b87 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/NonCat.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/NonCat.pm
@@ -188,7 +188,7 @@ sub noncat_due_date {
 
     my $duedate = $_dt_parser->parse_datetime( cleanse_ISO8601($circ->circ_time) );
     $duedate = $duedate
-        ->add( seconds => interval_to_seconds($otype->circ_duration) )
+        ->add( seconds => interval_to_seconds($otype->circ_duration, $duedate) )
         ->strftime('%FT%T%z');
 
     my $offset = $U->storagereq(

-----------------------------------------------------------------------

Summary of changes:
 .../lib/OpenILS/Application/Circ/Circulate.pm      |    6 +-----
 .../lib/OpenILS/Application/Circ/NonCat.pm         |    2 +-
 2 files changed, 2 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list