Hi,
I read the post filtering by a range of results and this FAQ and am therefore trying to use
to filter by a range of dates. However, nothing happens when I fill in the datemin or datemax fields and submit. (This is in the conditions box under models, and the fields code is in the footer.) I'm wondering if this has to do with the fact that the field I'm comparing to (view_Docs.DATEIN) is a timestamp in the database. I convert it to a date using
in the php functions box under Front List.
I've tried everything I can think of to change \GCore\Libs\Request::data("datemin") to the same format as view_Docs.DATEIN so they'll compare correctly, but no matter what I do, it's as if there is no condition at all.
Is there a way to fix it so the comparison works?
Any advice is appreciated!!
Thanks,
AK
I read the post filtering by a range of results and this FAQ and am therefore trying to use
<?php
if(\GCore\Libs\Request::data("datemin")){
return array("view_Docs.DATEIN >=" => \GCore\Libs\Request::data("datemin");}
if(\GCore\Libs\Request::data("datemax")){
return array("view_Docs.DATEIN <=" => \GCore\Libs\Request::data("datemax"));}
?>
to filter by a range of dates. However, nothing happens when I fill in the datemin or datemax fields and submit. (This is in the conditions box under models, and the fields code is in the footer.) I'm wondering if this has to do with the fact that the field I'm comparing to (view_Docs.DATEIN) is a timestamp in the database. I convert it to a date using
view_Docs.DATEIN:return date('m/d/Y', strtotime($cell));
in the php functions box under Front List.
I've tried everything I can think of to change \GCore\Libs\Request::data("datemin") to the same format as view_Docs.DATEIN so they'll compare correctly, but no matter what I do, it's as if there is no condition at all.
Is there a way to fix it so the comparison works?
Any advice is appreciated!!
Thanks,
AK