From: erickson Date: Mon, 9 Oct 2006 16:32:56 +0000 (+0000) Subject: updated due-dates format to conform with vendors - still need to decide if the hour... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=89fbb23347c089a121cadc792aaa7f1b3899e233;p=evergreen%2Fpines.git updated due-dates format to conform with vendors - still need to decide if the hour/min/second part should be pushed to the end of the day (23:59:59) since that is more accurate git-svn-id: svn://svn.open-ils.org/ILS/trunk@6419 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/SIP.pm b/Open-ILS/src/perlmods/OpenILS/SIP.pm index 9b88a805cb..4dd40bea31 100644 --- a/Open-ILS/src/perlmods/OpenILS/SIP.pm +++ b/Open-ILS/src/perlmods/OpenILS/SIP.pm @@ -107,6 +107,8 @@ sub make_editor { sub format_date { my $class = shift; my $date = shift; + my $type = shift || 'dob'; + return "" unless $date; $date = DateTime::Format::ISO8601->new-> @@ -120,7 +122,10 @@ sub format_date { $mon =~ s/^(\d)$/0$1/; $day =~ s/^(\d)$/0$1/; $date = "$year$mon$day"; - syslog('LOG_DEBUG', "OILS: formatted date: $date"); + + $date = $year.'-'.$mon.'-'.$day .' 0:00:00' if $type eq 'due'; + + syslog('LOG_DEBUG', "OILS: formatted date [type=$type]: $date"); return $date; } diff --git a/Open-ILS/src/perlmods/OpenILS/SIP/Item.pm b/Open-ILS/src/perlmods/OpenILS/SIP/Item.pm index 2c26cee194..a0777860ea 100644 --- a/Open-ILS/src/perlmods/OpenILS/SIP/Item.pm +++ b/Open-ILS/src/perlmods/OpenILS/SIP/Item.pm @@ -243,7 +243,7 @@ sub due_date { return 0; } - my $due = OpenILS::SIP->format_date($circ->due_date); + my $due = OpenILS::SIP->format_date($circ->due_date, 'due'); syslog('LOG_DEBUG', "OILS: Found item due date = $due"); return $due; } diff --git a/Open-ILS/src/perlmods/OpenILS/SIP/Transaction/Checkout.pm b/Open-ILS/src/perlmods/OpenILS/SIP/Transaction/Checkout.pm index 5140fd7c9d..d2ada4efb0 100644 --- a/Open-ILS/src/perlmods/OpenILS/SIP/Transaction/Checkout.pm +++ b/Open-ILS/src/perlmods/OpenILS/SIP/Transaction/Checkout.pm @@ -126,7 +126,7 @@ sub do_checkout { syslog('LOG_INFO', "OILS: Checkout succeeded"); my $circ = $resp->{payload}->{circ}; - $self->{'due'} = OpenILS::SIP->format_date($circ->due_date); + $self->{'due'} = OpenILS::SIP->format_date($circ->due_date, 'due'); $self->ok(1); return 1;