Patch from John Craig providing a saner timestamp cleansing setup for backdated circs
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 20 Jul 2010 19:54:38 +0000 (19:54 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 20 Jul 2010 19:54:38 +0000 (19:54 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16986 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Circ.pm

index 2cbc4bd..2a414d3 100644 (file)
@@ -373,9 +373,9 @@ sub set_circ_claims_returned {
         my $original_date = DateTime::Format::ISO8601->new->parse_datetime(cleanse_ISO8601($circ->due_date));
         my $new_date = DateTime::Format::ISO8601->new->parse_datetime($backdate);
         $backdate = $new_date->ymd . 'T' . $original_date->strftime('%T%z');
-        if ($backdate =~ /^(\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d-\d\d)(\d\d)$/) {
-            $backdate = "$1:$2"; # put a colon in the timestamp component for DateTime::Format::ISO8601->parse_datetime
-        }
+
+        # clean it up once again; need a : in the timezone offset. E.g. -06:00 not -0600
+        $backdate = cleanse_ISO8601($backdate);
 
         # make it look like the circ stopped at the cliams returned time
         $circ->stop_fines_time($backdate);