Filtering records in CMS by date range

5 posts by 2 authors in: Forums > CMS Builder
Last Post: March 10, 2013   (RSS)

By pault - March 7, 2013

Please can you let me know if it's possible to add a date range selection under the 'advanced search' area of a list of records within CMS Builder.

For example I may want to only show records with createdDate of yesterday or today so would need a from and to date range.

Thanks, Paul.

By gregThomas - March 7, 2013

Hi Paul, 

This is possible, your strings for the advanced search would need to look like this:

Created Before|date|max
Created After|date|min

You would need to replace |date| with whatever date field you want to use. 

This will create a date selector pop up next to the field, so that the search term will be in the correct format.

The only issue is that the date selector pop up is not created for createdDate field, as CMS Builder thinks of it as an hidden field as opposed to a date field, so the user will have to enter the date in the correct format for it to work. The format should be: YYYY-MM-DD 00:00:00, for example today would be 2013-03-07 00:00:00.

Let me know if you have any questions. 

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By pault - March 7, 2013

Hi Greg,

Thanks so much for your reply, this is great news.  I've just tried it out and it works as you've described but by putting two fields, one for created before and one for created after, the date picker only appears on the second one.

Perhaps when you've got a minute you could take a look and let me know if this is a software problem or my problem!

Thanks again, Paul.

By gregThomas - March 8, 2013

Hi Paul,

I've done some local testing and the advanced search did display two date picker boxes for me. Which version of CMS Builder are you using? Could you post up your advanced search strings for me? 

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com