From 37a17d8fadf745aa9a236f96a1fb5c9665651f04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Mon, 6 Dec 2010 14:52:06 -0500 Subject: [PATCH] Bug 5475 Wrong messages date formating on Check Out page On the Check Out page, messages related to the borrower are displayed on the right side. Message text is preceded by a date and library code. The date is displayed in US format (mm/dd/YYY). Is should be displayed formated depending on 'dateformat' syspref. Signed-off-by: Owen Leonard Signed-off-by: Chris Cormack --- C4/Members.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/C4/Members.pm b/C4/Members.pm index 4c1d37c49f..00716cd0f7 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -2073,7 +2073,7 @@ sub GetMessages { my $query = "SELECT branches.branchname, messages.*, - DATE_FORMAT( message_date, '%m/%d/%Y' ) AS message_date_formatted, + message_date, messages.branchcode LIKE '$branchcode' AS can_delete FROM messages, branches WHERE borrowernumber = ? @@ -2085,6 +2085,8 @@ sub GetMessages { my @results; while ( my $data = $sth->fetchrow_hashref ) { + my $d = C4::Dates->new( $data->{message_date}, 'iso' ); + $data->{message_date_formatted} = $d->output; push @results, $data; } return \@results;