-% #false laziness with cust_pkg.cgi and cust_pay.cgi
-% if ( $cgi->param('beginning')
-% && $cgi->param('beginning') =~ /^([ 0-9\-\/]{1,10})$/ ) {
-% my $beginning = str2time($1);
-% push @search, "_date >= $beginning ";
-% }
-% if ( $cgi->param('ending')
-% && $cgi->param('ending') =~ /^([ 0-9\-\/]{1,10})$/ ) {
-% my $ending = str2time($1) + 86399;
-% push @search, " _date <= $ending ";
-% }
+% my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi);
+% push @search, "_date >= $beginning ",
+% "_date <= $ending";