From b5123a5f2ae7234566354e2c4d2d00f29fa26504 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch>
Date: Sun, 15 Mar 2015 12:05:06 +0100
Subject: [PATCH] Bug 13813 - Remove C4::Dates from members/moremember.pl

To test:
Apply patch
Go to a patron's Details page (moremember.pl)
Verify that dates display correctly (birth date, registration, espiration, manual restriction with date)

Amended following comment #58 /mv
---
 members/moremember.pl |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/members/moremember.pl b/members/moremember.pl
index 7dc7ef3..4ce82a2 100755
--- a/members/moremember.pl
+++ b/members/moremember.pl
@@ -42,7 +42,6 @@ use C4::Output;
 use C4::Members;
 use C4::Members::Attributes;
 use C4::Members::AttributeTypes;
-use C4::Dates;
 use C4::Reserves;
 use C4::Circulation;
 use C4::Koha;
@@ -134,7 +133,7 @@ foreach (qw(dateenrolled dateexpiry dateofbirth)) {
 			$data->{$_} = '';
 			next;
 		}
-		$userdate = C4::Dates->new($userdate,'iso')->output('syspref');
+		$userdate = output_pref({ dt => dt_from_string( $userdate, 'iso' ), dateonly => 1 });
 		$data->{$_} = $userdate || '';
 		$template->param( $_ => $userdate );
 }
@@ -148,7 +147,7 @@ if ( IsDebarred($borrowernumber) ) {
     $template->param( 'userdebarred' => 1, 'flagged' => 1 );
     my $debar = $data->{'debarred'};
     if ( $debar ne "9999-12-31" ) {
-        $template->param( 'userdebarreddate' => C4::Dates::format_date($debar) );
+        $template->param( 'userdebarreddate' => output_pref({ dt => dt_from_string( $debar, 'iso' ), dateonly => 1 }) );
         $template->param( 'debarredcomment'  => $data->{debarredcomment} );
     }
 }
@@ -349,7 +348,7 @@ $template->param(
     categoryname    => $data->{'description'},
     was_renewed     => $input->param('was_renewed') ? 1 : 0,
     branch          => $branch,
-    todaysdate      => C4::Dates->today(),
+    todaysdate      => output_pref({ dt => dt_from_string, dateonly => 1 }),
     totalprice      => sprintf("%.2f", $totalprice),
     totaldue        => sprintf("%.2f", $total),
     totaldue_raw    => $total,
-- 
1.7.10.4