Changed the scripts to use format_date
This commit is contained in:
parent
d9ebc9a714
commit
8b4a044bb5
|
|
@ -24,6 +24,7 @@ use C4::Context;
|
|||
use C4::Reserves2;
|
||||
# FIXME - C4::Search uses C4::Reserves2, which uses C4::Search.
|
||||
# So Perl complains that all of the functions here get redefined.
|
||||
use C4::Date;
|
||||
|
||||
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
|
||||
|
||||
|
|
@ -1255,10 +1256,7 @@ sub ItemInfo {
|
|||
my $isth=$dbh->prepare($iquery);
|
||||
$isth->execute;
|
||||
if (my $idata=$isth->fetchrow_hashref){
|
||||
# FIXME - The date ought to be properly parsed, and printed
|
||||
# according to local convention.
|
||||
my @temp=split('-',$idata->{'date_due'});
|
||||
$datedue = "$temp[2]/$temp[1]/$temp[0]";
|
||||
$datedue = format_date($idata->{'date_due'});
|
||||
}
|
||||
if ($data->{'itemlost'} eq '2'){
|
||||
$datedue='Very Overdue';
|
||||
|
|
@ -1305,8 +1303,7 @@ sub ItemInfo {
|
|||
# FIXME - If $data->{'datelastseen'} is NULL, perhaps it'd be prettier
|
||||
# to leave it empty, rather than convert it to "//".
|
||||
# Also ideally this should use the local format for displaying dates.
|
||||
my @temp=split('-',$data->{'datelastseen'});
|
||||
my $date="$temp[2]/$temp[1]/$temp[0]";
|
||||
my $date=format_date($data->{'datelastseen'});
|
||||
$data->{'datelastseen'}=$date;
|
||||
$data->{'datedue'}=$datedue;
|
||||
$data->{'class'}=$class;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ use C4::Output;
|
|||
use C4::Koha;
|
||||
use C4::Auth;
|
||||
use HTML::Template;
|
||||
use C4::Date;
|
||||
|
||||
# get all the data ....
|
||||
my %env;
|
||||
|
|
@ -92,7 +93,7 @@ $template->param( bib => $bib,
|
|||
barcode => $idata->{'barcode'},
|
||||
homebranch =>$homebranch,
|
||||
holdingbranch => $holdingbranch,
|
||||
lastdate => $lastdate,
|
||||
lastdate => format_date($lastdate),
|
||||
count => $count,
|
||||
branchloop => \@branchloop);
|
||||
|
||||
|
|
@ -194,5 +195,5 @@ sub slashdate {
|
|||
return "never";
|
||||
}
|
||||
my ($yr, $mo, $da, $hr, $mi) = (substr($date, 0, 4), substr($date, 4, 2), substr($date, 6, 2), substr($date, 8, 2), substr($date, 10, 2));
|
||||
return "$hr:$mi $da/$mo/$yr";
|
||||
return "$hr:$mi " . format_date("$yr-$mo-$da");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ use CGI;
|
|||
use C4::Search;
|
||||
use C4::Auth;
|
||||
use C4::Interface::CGI::Output;
|
||||
use C4::Date;
|
||||
|
||||
my $query=new CGI;
|
||||
my $type=$query->param('type');
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ use C4::Circulation::Circ2;
|
|||
use C4::Auth;
|
||||
use C4::Interface::CGI::Output;
|
||||
use HTML::Template;
|
||||
use C4::Date;
|
||||
|
||||
my $query = new CGI;
|
||||
my ($template, $borrowernumber, $cookie)
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ foreach my $br (keys %$branches) {
|
|||
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =localtime(time);
|
||||
$year=$year+1900;
|
||||
$mon++;
|
||||
my $date="$mday/$mon/$year";
|
||||
my $date=format_date("$year-$mon-$mday");
|
||||
|
||||
|
||||
# get biblioitem information and build rows for form
|
||||
|
|
|
|||
Loading…
Reference in New Issue