Topic: Dates range
Hello
Is there any way i can make the "Dates from/to" (http://test.rapyd.com/filtered_grid/index) in rapyd 0.9 ?
I am modifying a project that uses rapyd 0.9 and for the moment we can't upgrade it
Thank you!
rapyd forum
You are not logged in. Please login or register.
Hello
Is there any way i can make the "Dates from/to" (http://test.rapyd.com/filtered_grid/index) in rapyd 0.9 ?
I am modifying a project that uses rapyd 0.9 and for the moment we can't upgrade it
Thank you!
Hi scobee
if I remember (from the code you sent me via email) you're probably using a really old version of rapyd, one used as "library of codeigniter":
http://codeigniter.com/wiki/Rapyd_Components
I'm not sure it's the 0.9 since syntax is with "new" and without chaining.
It's a bit problematic to help you with this old code but.. the ability to use datafilter with a range of date is an old stuff.
post some code.. and try to find correct versions of rapyd (even pubblication date, if present) and CI (if you're using CI+rapyd)
bye
i am looking in rapyd/classes and all of them are * @version 0.9.6
common.php is * @version 0.9
and the only one that is outdated is loader.php .. wich has * @version 0.7 and * @version 0.6.1
and yes, you are right, i am using CI + Rapyd
the CI version is: 1.5.4 (the guys who worked at this project told me that they haven't been able to update it because of rapyd)
do you think we could be able to upgrade rapyd without screwing up everything ? a little hack so that the old code will work + we will be able to use the new code too ?
thank you
Last edited by Scobee (2012-03-13 09:05:32)
Ok, 0.9.6 is versioning of the old "rapyd library" for CI, discontinued in 2008.
Since 2009 rapyd is a stand alone framework, and sometimes i release a version that works with latest CI as subframework.
Syntax of rapyd widgets (forms, grids, etc.. ) and crud code is changed alot, so you can't upgrade without rewrite code in your application.
However, I found some code on really old website i made:
...
$filter->begindate = new dateField("created", "created_begin","eu");
$filter->begindate->db_name="users.created";
$filter->begindate->clause="where";
$filter->begindate->operator=">";
$filter->enddate = new dateField("created", "created_end_date","eu");
$filter->enddate->db_name="users.created";
$filter->enddate->clause="where";
$filter->enddate->operator="<=";
$filter->enddate->in="begindate";
...I'm not sure it can work in your exact env. but, the concept is..
all you need is to fill "db_name", "clause" and "operator" ("in" only make fields stay on the same output row)
The second param of dateField is an arbitrary alias for the field (you need to have 2 different alias) and you must specify the same db_name (the real name of date field you need to filter from/to)
It worked! Thank you so much!