Date Searches

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

By gkornbluth - March 27, 2009

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: [ross] Date Searches

By gkornbluth - March 28, 2009

Hi Ross,

Thanks for looking at this. It's a pretty simple page.

Just a listing page with 2 date format fields... A start date date field and and end date field, a title, an image, and a short description of the event. (Right now the date fields are still text fields)

You can see it at:
www.artistsofpalmbeachcounty.org/events.php

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 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: [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/