I need the date to display in the grid and search dialog as d/m/Y but have the search dialog return it in the format Y-m-d to filter a datetime field. My code:-
$grid->setColProperty(“LEAfter”, array(“label”=>”Licence ends on or after”, “width”=>30, “hidden”=>true, “searchoptions”=>array(“searchhidden”=>true, “sopt”=>array(“ge”))));
$grid->setColProperty(“LEBefore”, array(“label”=>”Licence ends on or before”, “width”=>30, “hidden”=>true, “searchoptions”=>array(“searchhidden”=>true, “sopt”=>array(“le”))));
and
$grid->setDatepicker(‘LEAfter’, array(“showOn”=>”focus”), true, true);
$grid->setDatepicker(‘LEBefore’, array(“showOn”=>”focus”), true, true);
$grid->setUserTime(“d/m/Y”);
$grid->SetUserDate(“d/m/Y”);
$grid->setDbDate(‘Y-m-d H:i:s’);
$grid->setDbTime(‘Y-m-d H:i:s’);
$grid->datearray = array(‘LEAfter’,’LEBefore’);
The dates are correctly displaying in the grid and search dialog as d/m/Y but remaining as d/m/Y in the resultant query instead of Y-m-d. Please let me know what I am doing wrong.
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top