diff options
Diffstat (limited to 'httemplate/edit')
-rwxr-xr-x | httemplate/edit/cust_main.cgi | 3 | ||||
-rwxr-xr-x | httemplate/edit/process/cust_main.cgi | 9 |
2 files changed, 10 insertions, 2 deletions
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index 57d4dac5e..daddd8ece 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -172,7 +172,8 @@ 'birthdate', $cust_main->birthdate, 'Date of Birth', - $conf->config('date_format') || "%m/%d/%Y") + $conf->config('date_format') || "%m/%d/%Y", + 1) %> </TABLE> 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') ) |