Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

CustomSearchContext and SearchFields for Date range


Go to End


4 Posts   2252 Views

Avatar
Terminator4

Community Member, 81 Posts

20 May 2010 at 12:11am

Hi,
I would like to setup the CustomSearchContext and SearchFields for Date range using one and/or two date boxes such as "From date" and "To date" and then be able to use the innate SS functionality for searching for such a range.

Please help.

Thanks

Avatar
Enclave SSC

Community Member, 31 Posts

19 August 2010 at 9:17pm

I would also love to know how to do this. I have seen WithinRangeFilter but cannot find anything on its use. Also appears incomplete. Is there anything that can be done without being to hackish?

I mean searching a single Date field for a range should be possible or at least the ability to add duplicate search context fields one for Greaterthan and one for Lessthan.

Avatar
Jedateach

Forum Moderator, 238 Posts

11 December 2010 at 11:07am

Edited: 11/12/2010 11:07am

+1 for seeing the WithinDateRange filter and field working.

..further to Enclave's suggestion I can imagine the SearchFilter form system allowing you to choose either:
search value,
search between,
search greater than,
search less than

ie allowing the user to customize how the search is done on the form, and the form will modify itself appropriately, such as showing two input boxes for searching between values.

..this should be made into a trac ticket, or discussed on the ss google dev group to actually see / hear about any progress.

Avatar
swaiba

Forum Moderator, 1899 Posts

11 December 2010 at 9:17pm

Sorry for my ignorance, but are you guys talking...
* searching the site
*forms
*model admin?

I'm adding this to model admin soon, I don't see a problem in doing so...