From 00d780e00e9f6239631aeb1ed9185497548fcbbe Mon Sep 17 00:00:00 2001 From: wolfpac444 Date: Wed, 26 Mar 2003 04:09:06 +0000 Subject: [PATCH] Hmm.. having problems getting my changes to Date.pm saved... --- C4/Date.pm | 1 - insertdata.pl | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/C4/Date.pm b/C4/Date.pm index 708e7f3dfa..f6c1e5859b 100644 --- a/C4/Date.pm +++ b/C4/Date.pm @@ -21,7 +21,6 @@ $VERSION = 0.01; ); - sub get_date_format { #Get the database handle diff --git a/insertdata.pl b/insertdata.pl index a14578be2f..95fe520f93 100755 --- a/insertdata.pl +++ b/insertdata.pl @@ -27,6 +27,7 @@ use C4::Context; use C4::Input; use C4::Search; use Date::Manip; +use C4::Date; use strict; my $input= new CGI; @@ -50,6 +51,8 @@ my $query="Select * from borrowers where borrowernumber=$data{'borrowernumber'}" my $sth=$dbh->prepare($query); $sth->execute; if (my $data=$sth->fetchrow_hashref){ + $data{'dateofbirth'}=fomat_date_in_iso($data{'dateofbirth'}); + $data{'joining'}=format_date_in_iso($data{'joining'}); $query="update borrowers set title='$data{'title'}',expiry='$data{'expiry'}', cardnumber='$data{'cardnumber'}',sex='$data{'sex'}',ethnotes='$data{'ethnicnotes'}', streetaddress='$data{'address'}',faxnumber='$data{'faxnumber'}',firstname='$data{'firstname'}', @@ -64,10 +67,8 @@ if (my $data=$sth->fetchrow_hashref){ # print $query; }else{ - $data{'dateofbirth'}=ParseDate($data{'dateofbirth'}); - $data{'dateofbirth'}=UnixDate($data{'dateofbirth'},'%Y-%m-%d'); - $data{'joining'}=ParseDate($data{'joining'}); - $data{'joining'}=UnixDate($data{'joining'},'%Y-%m-%d'); + $data{'dateofbirth'}=fomat_date_in_iso($data{'dateofbirth'}); + $data{'joining'}=format_date_in_iso($data{'joining'}); $query="insert into borrowers (title,expiry,cardnumber,sex,ethnotes,streetaddress,faxnumber, firstname,altnotes,dateofbirth,contactname,emailaddress,textmessaging,dateenrolled,streetcity, altrelationship,othernames,phoneday,categorycode,city,area,phone,borrowernotes,altphone,surname, -- 2.39.5