From: phasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4> Date: Thu, 8 Jul 2010 17:09:36 +0000 (+0000) Subject: Fixes Mark Claimed Returned. It seems that dojo isn't the only library picky about... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=23f9d1e285f7e8ab9ba4e6daa10ae7c4c4f117d2;p=evergreen%2Fpines.git Fixes Mark Claimed Returned. It seems that dojo isn't the only library picky about ISO8601; DateTime::Format::ISO8601->parse_datetime was choking in this case git-svn-id: svn://svn.open-ils.org/ILS/trunk@16886 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm index 794dba3542..483fc4539f 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm @@ -373,6 +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 + } # make it look like the circ stopped at the cliams returned time $circ->stop_fines_time($backdate); @@ -502,6 +505,9 @@ sub set_circ_due_date { my $original_date = DateTime::Format::ISO8601->new->parse_datetime(cleanse_ISO8601($circ->due_date)); my $new_date = DateTime::Format::ISO8601->new->parse_datetime($date); $date = $new_date->ymd . 'T' . $original_date->strftime('%T%z'); + if ($date =~ /^(\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d-\d\d)(\d\d)$/) { + $date = "$1:$2"; # put a colon in the timestamp component for DateTime::Format::ISO8601->parse_datetime + } } $circ->due_date($date);