|
From: <mjd...@us...> - 2009-06-15 23:38:56
|
Revision: 53
http://treebase.svn.sourceforge.net/treebase/?rev=53&view=rev
Author: mjdominus
Date: 2009-06-15 23:38:04 +0000 (Mon, 15 Jun 2009)
Log Message:
-----------
Added handler for ISO 8601 dates
Modified Paths:
--------------
trunk/treebase-core/src/main/perl/lib/CIPRES/TreeBase/RecDumper.pm
Modified: trunk/treebase-core/src/main/perl/lib/CIPRES/TreeBase/RecDumper.pm
===================================================================
--- trunk/treebase-core/src/main/perl/lib/CIPRES/TreeBase/RecDumper.pm 2009-06-15 23:31:27 UTC (rev 52)
+++ trunk/treebase-core/src/main/perl/lib/CIPRES/TreeBase/RecDumper.pm 2009-06-15 23:38:04 UTC (rev 53)
@@ -80,11 +80,16 @@
}
}
elsif ($t eq 'DATE'){
+ my ( $day, $month, $year );
if ( m|(\d{1,2})/(\d{1,2})/(\d{4})| ) {
- my ( $day, $month, $year ) =
- ( $1, $2, $3 );
- $_ = "'${year}-${month}-${day}'";
+ ( $day, $month, $year ) =
+ ( $1, $2, $3 );
}
+ if ( m|(\d{4})-(\d{1,2})-(\d{1,2})| ) {
+ ( $year, $month, $day ) =
+ ( $1, $2, $3 );
+ }
+ $_ = "'${year}-${month}-${day}'";
}
else {
croak("Unknown field type '$t'; aborting");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|