[Koha-patches] [PATCH] Bug 6029 : Date processinghas to be done on all dates

Chris Cormack chrisc at catalyst.net.nz
Thu Mar 31 23:56:52 CEST 2011


From: Henri-Damien LAURENT <henridamien.laurent at biblibre.com>

---
 C4/Letters.pm |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/C4/Letters.pm b/C4/Letters.pm
index 34e3686..fb956d2 100644
--- a/C4/Letters.pm
+++ b/C4/Letters.pm
@@ -523,17 +523,12 @@ sub parseletter {
     # TEMPORARY hack until the expirationdate column is added to reserves
     if ( $table eq 'reserves' && $values->{'waitingdate'} ) {
         my @waitingdate = split /-/, $values->{'waitingdate'};
-
-        $values->{'expirationdate'} = C4::Dates->new(
-            sprintf(
-                '%04d-%02d-%02d',
-                Add_Delta_Days( @waitingdate, C4::Context->preference( 'ReservesMaxPickUpDelay' ) )
-            ),
-            'iso'
-        )->output();
+        $values->{'expirationdate'} = Add_Delta_Days( @waitingdate, C4::Context->preference('ReservesMaxPickUpDelay') );
+    }
+    for my $datefield (grep {$_ =~/date/} keys %$values){
+        # Format all date field in order to display date according to system 
+        $values->{$datefield}=C4::Dates->new($values->{$datefield})->output();
     }
-
-
     # and get all fields from the table
     my $columns = C4::Context->dbh->prepare("SHOW COLUMNS FROM $table");
     $columns->execute;
-- 
1.7.1



More information about the Koha-patches mailing list