From 7273e0f0dab192f2513ca04a1d6292f6bb5868f3 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Tue, 23 Oct 2007 13:42:03 -0500 Subject: [PATCH] Removing windows linefeeds \r Signed-off-by: Joshua Ferraro --- C4/NewsChannels.pm | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/C4/NewsChannels.pm b/C4/NewsChannels.pm index 4369da3140..0d9bf61ed2 100644 --- a/C4/NewsChannels.pm +++ b/C4/NewsChannels.pm @@ -20,7 +20,7 @@ package C4::NewsChannels; use strict; use C4::Context; -use C4::Dates qw(DHTMLcalendar format_date); +use C4::Date; use vars qw($VERSION @ISA @EXPORT); @@ -50,7 +50,7 @@ This module provides the functions needed to admin the news channels and its cat &news_channels &get_new_channel &del_channels &add_channel &update_channel &news_channels_categories &get_new_channel_category &del_channels_categories &add_channel_category &update_channel_category &news_channels_by_category - &add_opac_new &upd_opac_new &del_opac_new &get_opac_new &get_opac_news +&add_opac_new &upd_opac_new &del_opac_new &get_opac_new &get_opac_news &add_opac_electronic &upd_opac_electronic &del_opac_electronic &get_opac_electronic &get_opac_electronics ); @@ -307,7 +307,6 @@ sub get_opac_news { my $count = 0; while (my $row = $sth->fetchrow_hashref) { if ((($limit) && ($count < $limit)) || (!$limit)) { - # format the dates in the user's requested format defined in sysprefs $row->{'newdate'} = format_date($row->{'newdate'}); $row->{'expirationdate'} = format_date($row->{'expirationdate'}); push @opac_news, $row; @@ -328,9 +327,8 @@ sub get_opac_news { sub GetNewsToDisplay { my $lang = shift; my $dbh = C4::Context->dbh; - my $dateformat = C4::Dates->DHTMLcalendar; my $query = " - SELECT *,DATE_FORMAT(timestamp, '$dateformat') AS newdate + SELECT *,DATE_FORMAT(timestamp, '%d/%m/%Y') AS newdate FROM opac_news WHERE ( expirationdate > CURRENT_DATE() @@ -397,8 +395,7 @@ sub get_opac_electronic { sub get_opac_electronics { my ($section, $lang) = @_; my $dbh = C4::Context->dbh; - my $dateformat = C4::Dates->DHTMLcalendar; - my $query = "SELECT *, DATE_FORMAT(timestamp, '$dateformat') AS newdate FROM opac_electronic"; + my $query = "SELECT *, DATE_FORMAT(timestamp, '%d/%m/%Y') AS newdate FROM opac_electronic"; if ($lang) { $query.= " WHERE lang = '" .$lang ."' "; } @@ -429,5 +426,3 @@ END { } # module clean-up code here (global destructor) TG =cut - - -- 2.20.1