LP#1635737 Due date DST-aware thinko fix
authorBill Erickson <berickxx@gmail.com>
Tue, 6 Nov 2018 21:22:43 +0000 (16:22 -0500)
committerDan Wells <dbw2@calvin.edu>
Wed, 7 Nov 2018 14:10:00 +0000 (09:10 -0500)
Minor code refactor to fix thinko and syntax issues.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm

index fab7796..73d69ef 100644 (file)
@@ -2396,11 +2396,11 @@ sub create_due_date {
     ) || 'local';
 
     my $due_date = $start_time ?
-        DateTime->now(time_zone => $tz) :
-        $due_date = DateTime::Format::ISO8601
+        DateTime::Format::ISO8601
             ->new
             ->parse_datetime(clean_ISO8601($start_time))
-            ->set_time_zone($tz);
+            ->set_time_zone($tz) :
+        DateTime->now(time_zone => $tz);
 
     # add the circ duration
     $due_date->add(seconds => OpenILS::Utils::DateTime->interval_to_seconds($duration, $due_date));