I keep getting an : 'Invalid date format:' error when trying to use > or < in a date field. Is there any way to get around this?
Jun 14, 1999, 6:55 PM
Veteran / Moderator (8669 posts)
Jun 14, 1999, 6:55 PM
Post #2 of 3
Views: 1754
I'm not sure if this is the problem, but there is a little bug in sub query in db.cgi
Look for a section in the subroutine that starts with
foreach $column (@db_cols) {
if ($in{$column} =~ /^\>(.+)$/)
Go down a few more lines and change the code to look like the following. (I'll try to put the changes in bold print if I can remember what the original was.) I have rearranged the lines a little bit, but you should be able to follow it.
($db_sort{$column} eq 'date') and (&date_to_unix($in{"$column-gt"}) or return "Invalid date format: '$in{$column}'");
push(@search_gt_fields, $i); }
if ($in{"$column-lt"} !~ /^\s*$/) {
($db_sort{$column} eq 'date') and (&date_to_unix($in{"$column-lt"}) or return "Invalid date format: '$in{$column}'");
push(@search_lt_fields, $i); }
I think that's it. Give 'er a try.
------------------
JPD
Look for a section in the subroutine that starts with
Code:
$i = 0; foreach $column (@db_cols) {
if ($in{$column} =~ /^\>(.+)$/)
Go down a few more lines and change the code to look like the following. (I'll try to put the changes in bold print if I can remember what the original was.) I have rearranged the lines a little bit, but you should be able to follow it.
Code:
if ($in{"$column-gt"} !~ /^\s*$/) { ($db_sort{$column} eq 'date') and (&date_to_unix($in{"$column-gt"}) or return "Invalid date format: '$in{$column}'");
push(@search_gt_fields, $i); }
if ($in{"$column-lt"} !~ /^\s*$/) {
($db_sort{$column} eq 'date') and (&date_to_unix($in{"$column-lt"}) or return "Invalid date format: '$in{$column}'");
push(@search_lt_fields, $i); }
I think that's it. Give 'er a try.
------------------
JPD