Home » RADICORE » How To » Search date between two dates in search screen
|
|
Re: Search date between two dates in search screen [message #1840 is a reply to message #1782] |
Fri, 14 November 2008 07:08   |
bonzo_bcn
Messages: 152 Registered: June 2008
|
Senior Member |
|
|
I just tried this, and it doesn't work for me.
In _cm_pre_getData() the two added fields aren't included in $fieldarray.
Also if I put this code in the detail screen:
$structure['main']['fields'][1][] = array('label' => 'Date From');
$structure['main']['fields'][1][] = array('field' => 'date_from');
$structure['main']['fields'][1][] = array('label' => 'To');
$structure['main']['fields'][1][] = array('field' => 'date_to');
the fields don't appear, I had to put this code to show the fields:
$structure['main']['fields'][] = array('label' => 'Date From');
$structure['main']['fields'][] = array('date_from' => 'date_from');
$structure['main']['fields'][] = array('label' => 'To');
$structure['main']['fields'][] = array('date_to' => 'date_to');
[Updated on: Fri, 14 November 2008 07:16] Report message to a moderator
|
|
|
|
Re: Search date between two dates in search screen [message #1843 is a reply to message #1782] |
Fri, 14 November 2008 11:14   |
bonzo_bcn
Messages: 152 Registered: June 2008
|
Senior Member |
|
|
So what should I do to make this work?
In _cm_pre_getData the tw date fields aren't in $fieldarray, therefore this code is never executed:
if (!empty($fieldarray['date_from']) OR !empty($fieldarray['date_to'])) {
$fieldarray['fecnac'] = rangeFromTo($fieldarray['date_from'], $fieldarray['date_to'], true);
unset($fieldarray['date_from']);
unset($fieldarray['date_to']);
} // if
I can see the search fields, but it doesn't filter correctly, are there any working example?
[Updated on: Fri, 14 November 2008 11:17] Report message to a moderator
|
|
|
|
|
|
|
Goto Forum:
Current Time: Thu Jun 19 11:30:27 EDT 2025
Total time taken to generate the page: 0.01241 seconds
|