Changed the scripts to use format_date
authorwolfpac444 <wolfpac444>
Thu, 8 May 2003 13:19:39 +0000 (13:19 +0000)
committerwolfpac444 <wolfpac444>
Thu, 8 May 2003 13:19:39 +0000 (13:19 +0000)
C4/Search.pm
bookcount.pl
detail.pl
opac/opac-account.pl
request.pl

index cbc091c..8ee2df0 100755 (executable)
@@ -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;
index 03605bd..bbb2709 100755 (executable)
@@ -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");
 }
index 917444d..82d57e2 100755 (executable)
--- 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');
index decafc3..3adab8b 100755 (executable)
@@ -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)
index fc2f914..5f71e08 100755 (executable)
@@ -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