[open-ils-commits] r15680 - trunk/Open-ILS/src/perlmods/OpenILS/Application (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Mar 3 14:36:15 EST 2010
Author: miker
Date: 2010-03-03 14:36:11 -0500 (Wed, 03 Mar 2010)
New Revision: 15680
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm
Log:
keep the original due_date time component of day-granular circs on due_date edit
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm 2010-03-03 19:18:55 UTC (rev 15679)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm 2010-03-03 19:36:11 UTC (rev 15680)
@@ -490,6 +490,13 @@
return $e->die_event unless $e->allowed('CIRC_OVERRIDE_DUE_DATE', $circ->circ_lib);
$date = cleanse_ISO8601($date);
+
+ if (!(interval_to_seconds($circ->duration) % 86400)) { # duration is divisible by days
+ 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');
+ }
+
$circ->due_date($date);
$e->update_action_circulation($circ) or return $e->die_event;
$e->commit;
More information about the open-ils-commits
mailing list