solved How to add a Search by date Range?

pch
@pch
9 years ago
328 posts
Hi Douglas

I am thankful for the great support you are providing.

You have already assisted me with some of the questions related to this topic here:
https://www.jamroom.net/the-jamroom-network/forum/using-jamroom/39942/how-to-upload-and-search-audio-and-video-by-date-and-location

but in order to organize things in the forum as Michael always suggests us I have decided to create a separate topic for this specific question:

How to add a Search by Date Range as an option in the main search?

I have created a date field as you advised me in the link above. How to allow users who don't remember anymore the subject or the audio or video title of an event or conference (but who know approximately when that event took place), to search by date range?

E.g: From: September 05, 2013 to: November 12, 2013

Then JR will return a result of that date range.

Thanks
updated by @pch: 10/25/16 05:52:46AM
michael
@michael
9 years ago
7,821 posts
Thanks for making a separate thread, it makes it easier to help :) and for others to search for help.

The site wide search function searches each of the active modules for the term your interested in, It currently does not have this functionality. There might be a way to add it via a module, but its probably a bit complicated. ( I haven't built that module, so don't know the issues that might arise )

I'll add this as a suggestion for an extension to the jrSearch module and we can have a look at how hard it would be.

In the mean time, what you can do is create a search for any of the individual modules you're interested in, that can be done now.

Each module stores its time of creation and time of update along with the item, those fields are:
* _created
* _updated

They are stored as a timestamp that looks like this 12569537329
The {jrCore_list} template function is the one that is responsible for returning results, you can add search queries to it

Docs: "{jrCore_list}"
https://www.jamroom.net/the-jamroom-network/documentation/development/89/jrcore-list

using this timestamp converter, http://www.timestampconvert.com/ we can see that the dates you want convert to these values:
September 05, 2013 = 1378310690
November 12, 2013 = 1384185933

So if you wanted all the jrAudio items created between those dates, the list call would be:
{jrCore_list module="jrAudio" search1="_created > 1378310690" search2="_created < 1384185933"}

Tags