[freeside-commits] freeside/httemplate/edit/process cust_main.cgi, 1.25, 1.26

Jeff Finucane,420,, jeff at wavetail.420.am
Wed Nov 15 22:20:40 PST 2006


Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory wavetail:/tmp/cvs-serv21828/httemplate/edit/process

Modified Files:
	cust_main.cgi 
Log Message:
switch birthdate to DateTime

Index: cust_main.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/cust_main.cgi,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- cust_main.cgi	9 Oct 2006 04:27:17 -0000	1.25
+++ cust_main.cgi	16 Nov 2006 06:20:38 -0000	1.26
@@ -54,7 +54,14 @@
 %}
 %
 %if ( $cgi->param('birthdate') && $cgi->param('birthdate') =~ /^([ 0-9\-\/]{0,10})$/ ) {
-%  $new->setfield('birthdate', str2time($1));
+%  eval "use DateTime::Format::Strptime;";
+%  die $@ if $@;
+%  my $conf = new FS::Conf;
+%  my $format = $conf->config('date_format') || "%m/%d/%Y";
+%  my $parser = DateTime::Format::Strptime->new(pattern => $format,
+%                                               time_zone => 'floating',
+%                                              );
+%  $new->setfield('birthdate', $parser->parse_datetime($1)->epoch);
 %}
 %
 %$new->setfield('paid', $cgi->param('paid') )



More information about the freeside-commits mailing list