diff options
author | jeff <jeff> | 2006-11-16 06:20:38 +0000 |
---|---|---|
committer | jeff <jeff> | 2006-11-16 06:20:38 +0000 |
commit | 7c1d5f4ce778b4ab56301a042076e7c1dce46152 (patch) | |
tree | 5043578159426a7f2b71f4dc08a1ce481efffae7 /httemplate/edit/process/cust_main.cgi | |
parent | 4fc89f725b1ef07a6f1687af0ddeb83988d493c1 (diff) |
switch birthdate to DateTime
Diffstat (limited to 'httemplate/edit/process/cust_main.cgi')
-rwxr-xr-x | httemplate/edit/process/cust_main.cgi | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index 33f7bb895..d5d127b2d 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -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') ) |