[freeside-commits] freeside/FS/FS/cdr bell_west.pm,1.1,1.2
Ivan,,,
ivan at wavetail.420.am
Wed Dec 31 14:04:48 PST 2008
Update of /home/cvs/cvsroot/freeside/FS/FS/cdr
In directory wavetail.420.am:/tmp/cvs-serv18094/cdr
Modified Files:
bell_west.pm
Log Message:
finish up working bell_west CDR format, RT#4403
Index: bell_west.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cdr/bell_west.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- bell_west.pm 31 Dec 2008 03:28:56 -0000 1.1
+++ bell_west.pm 31 Dec 2008 22:04:46 -0000 1.2
@@ -24,10 +24,16 @@
# DATE / Yes / "DATE" Excel date format MM/DD/YYYY
sub { my($cdr, $date) = @_;
- $date =~ /^(\d{1,2})\/(\d{1,2})\/(\d\d(\d\d)?)$/
- or die "unparsable date: $date"; #maybe we shouldn't die...
- #$cdr->startdate( timelocal(0, 0, 0 ,$2, $1-1, $3) );
- ($tmp_mday, $tmp_mon, $tmp_year) = ( $2, $1-1, $3 );
+
+ #$date =~ /^(\d{1,2})\/(\d{1,2})\/(\d\d(\d\d)?)$/
+ # or die "unparsable date: $date"; #maybe we shouldn't die...
+ ##$cdr->startdate( timelocal(0, 0, 0 ,$2, $1-1, $3) );
+ #($tmp_mday, $tmp_mon, $tmp_year) = ( $2, $1-1, $3 );
+
+ my $datetime = DateTime::Format::Excel->parse_datetime( $date );
+ $tmp_mon = $datetime->mon_0;
+ $tmp_mday = $datetime->mday;
+ $tmp_year = $datetime->year;
},
# CUST NO / Yes / "TIME" "075959" Text based time
@@ -35,7 +41,7 @@
# is wrong
sub { my($cdr, $time) = @_;
#my($sec, $min, $hour, $mday, $mon, $year)= localtime($cdr->startdate);
- $time =~ /^(\d{1,2}):(\d{1,2}):(\d{1,2})$/
+ $time =~ /^(\d{2})(\d{2})(\d{2})$/
or die "unparsable time: $time"; #maybe we shouldn't die...
#$cdr->startdate( timelocal($3, $2, $1 ,$mday, $mon, $year) );
$cdr->startdate(
More information about the freeside-commits
mailing list