Quantcast
Channel: ASPRunner forums
Viewing all articles
Browse latest Browse all 2586

setSearchOption bugged

$
0
0
Hello,
I'm trying to set a default date range for recors on a list page. I use the following code in "After table initialized" of the "news" table to get records of the last 5 days:


FIRST BUG:

$srchObj = SearchClause::getSearchObject("news_table")

$srchObj->setSearchOption("newsdate", BETWEEN);
$srchObj->setFieldValue("newsdate",date("Y-m-d",strtotime('-5 days')) );
$srchObj->setSecondFieldValue("newsdate",date("Y-m-d") );


I tried also with

$srchObj->setSearchOption("newsdate", MORE_THAN);


In both cases I get the search field formatted as an "equal" field and the code does not work.

SECOND BUG:
I use european dates (d/m/Y). If I pass the date in this format the first field of the between seacrh does not work, but the second does.
If I pass dates in the format Y-m-d as in the code above, the first field work but the second doesn't.


Does anybody have any workaround until the functionality will be fixed? Thanks!

Viewing all articles
Browse latest Browse all 2586

Trending Articles