From 8b4a044bb50dcaa6358fee47915a782deac5fef2 Mon Sep 17 00:00:00 2001 From: wolfpac444 Date: Thu, 8 May 2003 13:19:39 +0000 Subject: [PATCH] Changed the scripts to use format_date --- C4/Search.pm | 9 +++------ bookcount.pl | 5 +++-- detail.pl | 1 + opac/opac-account.pl | 1 + request.pl | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index cbc091cb09..8ee2df0e6a 100755 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -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; diff --git a/bookcount.pl b/bookcount.pl index 03605bd31f..bbb2709b04 100755 --- a/bookcount.pl +++ b/bookcount.pl @@ -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"); } diff --git a/detail.pl b/detail.pl index 917444d6b7..82d57e2738 100755 --- a/detail.pl +++ b/detail.pl @@ -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'); diff --git a/opac/opac-account.pl b/opac/opac-account.pl index decafc38a6..3adab8b285 100755 --- a/opac/opac-account.pl +++ b/opac/opac-account.pl @@ -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) diff --git a/request.pl b/request.pl index fc2f914384..5f71e084ca 100755 --- a/request.pl +++ b/request.pl @@ -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 -- 2.39.2