Date Searches

6 posts by 2 authors in: Forums > CMS Builder
Last Post: March 31, 2009   (RSS)

I’m trying to set up some search criteria for an arts organization events list.

There are date fields set up for a start date and an end date among others.

Some events extend over many months.

Example: If the start date is January 2009 and the end date is June 2009 and someone searches for April 2009 events, they would like that event to appear in the list.

Any ideas?

Thanks,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Date Searches

By ross - March 27, 2009

Hi Jerry

Thanks for posting!

Could you show me the page you are doing your searching on? I'd like to see how you have it setup :).

We do date searching fairly often for things like expired articles so there should be an option for you here.

Let me know :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [gkornbluth] Date Searches

By ross - March 30, 2009

Hi Jerry

Thanks for the link :).

I am actually thinking that instead of setting up a bunch of search code, use the built in "removeDate" function.

To use this, just change the field name of your end date to "removeDate" (for both the label and the field name) and that should be it.

From there, your items will only be displayed if the current date before what you select in that field.

CMS Builder will automatically stop showing them once the event is over.

Give this a shot and let me know how you make out :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] Date Searches

Good afternoon Ross,

I think you may have been misled by the way I described the situation.

In the above, let's say a user searches for "April" events as their search criteria and the start date of an event is in "March" and the end date is in "May".

I'm assuming that an "April" listing won't show in the result list unless I've programmed the search to show any "Month" that matches the start date month, or the end date month, or that is between a start date month and the end date month?

I just don't have a clue how to do that.

Thanks,

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Date Searches

By ross - March 31, 2009

Hi Jerry

I think what you are running into here is that CMS Builder searching is "AND" based. So when you do a search with both the start and end date, the search is like this:

find me all listings that have a start date after tuesday AND an end date before Friday. Listings that have an end date after Friday, won't show up.

What you could do is have the search only check the start date, or just make sure your end date encompasses all the possible dates you would like.

Does that make sense?
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/