0

i want to do a search of range date using quicksearch item, but until now i realize that in the class quicksearch is a line with this code :

$this->search_field=$this->addField('line','q','')->setNoSave();

the only thing i did is to change into this:

$this->search_field=$this->addField('DatePicker','a','Desde :')->setNoSave();

I just change "line" to "DatePicker", so simple i guess,now if i add a quick search to my manager page has 2 icons, one with the icon search and the other with icon calendar, so if i search a date, i just select the date and hit the icon search, and gets me the all the results with that date, tha´ts perfect, but what happen if I add 2 quicksearchs and try to do a range date search?? the only message i get is "No Records Found".

So the question is.. How do i do range date search? I realize that exists another line in the function postinit:

$or->where($field,'like','%'.$v.'%');

maybe it will work if i put another query?

$or->where($field>=$v) or something like that?? i have spend more than 3 days trying to do this range date search?

So if anyone has some corrections with this code i would be more than happy

romaninsh
  • 10,606
  • 4
  • 50
  • 70

1 Answers1

0

Try this

$or->where(array(
      array($field,'>=',$from_date),
      array($field,'<=',$till_date),
));
Vadym
  • 749
  • 3
  • 15