From 304deaadf103e33bd43db1a51c7c8bd58cf4c5e6 Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Fri, 23 Nov 2007 19:26:11 +0100 Subject: [PATCH] (atz, pls validate) bugfixing dates viewing on moremember There were 2 bugs : - one in moremember.pl that supposed the date value to be in preffered order, which is wrong, it's in iso at this time - the output does not work as expected, as it always return iso. Pls atz, confirm Dates.pm was bugged. Signed-off-by: Joshua Ferraro --- C4/Dates.pm | 2 +- members/moremember.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Dates.pm b/C4/Dates.pm index 320d04d62b..a602d311ed 100644 --- a/C4/Dates.pm +++ b/C4/Dates.pm @@ -98,7 +98,7 @@ sub init ($;$$) { } sub output ($;$) { my $self = shift; - my $newformat = (@_) ? _recognize_format(shift) : $self->{'dateformat'} ; + my $newformat = (@_) ? _recognize_format(shift) : $prefformat; return (eval {POSIX::strftime($posix_map{$newformat}, @self::dmy_array)} || undef); } sub today ($;$) { # NOTE: sets date value to today (and returns it in the requested or current format) diff --git a/members/moremember.pl b/members/moremember.pl index 405cb99a4b..2145d9b9bd 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -96,7 +96,7 @@ my $category_type = $borrowercategory->{'category_type'}; $template->param( $data->{'categorycode'} => 1 ); foreach (qw(dateenrolled dateexpiry dateofbirth)) { - my $tempdate = C4::Dates->new($data->{$_})->output('iso') + my $tempdate = C4::Dates->new($data->{$_},'iso')->output or warn ("Invalid $_ = " . $data->{$_}); $data->{$_} = $tempdate || ''; } -- 2.39.5