From fc228b5986b500d8be4fdbf7c268096935d03f88 Mon Sep 17 00:00:00 2001 From: Mason James Date: Wed, 17 Apr 2013 22:47:26 +1200 Subject: [PATCH] Bug 9084 - Dates in notices should be formatted according to dateformat system preference Content-Type: text/plain; charset="utf-8" --- C4/Letters.pm | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index fdbb473..061e6a8 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -617,7 +617,22 @@ sub _parseletter { $letter->{content} =~ s/<>/$todaysdate/go; } + my @dates = qq| issues.date_due issues.date old_issues.date_due + old_issues.returndate old_issues.issuedate |; + while ( my ($field, $val) = each %$values ) { + + # Bug 9084 - Dates in notices should be formatted + # according to dateformat system preference + my $match = "$table.$field"; + if ( grep /$match/, @dates ) { + + #display dateonly, if timestamp has trailing '23:59:00' + my $dateonly = 0; + $dateonly = 1 if $val =~ /23:59:00$/; + $val = output_pref( dt_from_string($val), undef, undef, $dateonly ); + } + my $replacetablefield = "<<$table.$field>>"; my $replacefield = "<<$field>>"; $val =~ s/\p{P}(?=$)//g if $val; -- 1.7.2.5