From fbfee9971ea1566c4b1ed92c48f2510143cc8268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20V=C3=A9ron?= Date: Fri, 13 Mar 2015 17:57:46 +0100 Subject: [PATCH] Bug 13813 - Remove C4::Dates from C4/NewsChannels.pm To test: Apply patch Create some news for OPAC and staff client (Home > Tools > News) Verify that dates appear as appropriate Verify that Publicaten Date (Creation Date) and Expiration Date work as expected. Note: Inconsistency in wording for creation date / publication date should be managed in separate Bug 13834 --- C4/NewsChannels.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/NewsChannels.pm b/C4/NewsChannels.pm index 8694c1b..f7fa1d7 100644 --- a/C4/NewsChannels.pm +++ b/C4/NewsChannels.pm @@ -20,7 +20,7 @@ package C4::NewsChannels; use Modern::Perl; use C4::Context; -use C4::Dates qw(format_date); +use Koha::DateUtils; use vars qw($VERSION @ISA @EXPORT); @@ -135,8 +135,8 @@ sub get_opac_new { $sth->execute($idnew); my $data = $sth->fetchrow_hashref; $data->{$data->{'lang'}} = 1 if defined $data->{lang}; - $data->{expirationdate} = format_date($data->{expirationdate}); - $data->{timestamp} = format_date($data->{timestamp}); + $data->{expirationdate} = output_pref({ dt => dt_from_string( $data->{expirationdate} ), dateonly => 1 }); + $data->{timestamp} = output_pref({ dt => dt_from_string( $data->{timestamp} ), dateonly => 1 }) ; return $data; } @@ -209,7 +209,7 @@ sub GetNewsToDisplay { $sth->execute($lang,$branch); my @results; while ( my $row = $sth->fetchrow_hashref ){ - $row->{newdate} = format_date($row->{newdate}); + $row->{newdate} = output_pref({ dt => dt_from_string( $row->{newdate} ), dateonly => 1 }); push @results, $row; } return \@results; -- 1.7.10.4