From e4386103cbdf5cd8695a639ee6ccb671d082f832 Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Mon, 31 Dec 2007 15:55:17 -0600 Subject: [PATCH] NewsChannels - format_date for news "Posted on" date Signed-off-by: Joshua Ferraro --- C4/NewsChannels.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/C4/NewsChannels.pm b/C4/NewsChannels.pm index 5a3def4350..29a258656d 100644 --- a/C4/NewsChannels.pm +++ b/C4/NewsChannels.pm @@ -326,8 +326,9 @@ sub get_opac_news { sub GetNewsToDisplay { my $lang = shift; my $dbh = C4::Context->dbh; + # SELECT *,DATE_FORMAT(timestamp, '%d/%m/%Y') AS newdate my $query = " - SELECT *,DATE_FORMAT(timestamp, '%d/%m/%Y') AS newdate + SELECT *,timestamp AS newdate FROM opac_news WHERE ( expirationdate > CURRENT_DATE() @@ -341,6 +342,7 @@ sub GetNewsToDisplay { $sth->execute($lang); my @results; while ( my $row = $sth->fetchrow_hashref ){ + $row->{newdate} = format_date($row->{newdate}); push @results, $row; } return \@results; -- 2.39.5