Search date range on CreatedDate

2 posts by 2 authors in: Forums > CMS Builder
Last Post: August 6, 2013   (RSS)

By Toledoh - August 5, 2013

Hi Guys,

Is there anyway that I can change the createdDate field to be usable as the search field?  I refer to http://www.interactivetools.com/forum/forum-posts.php?postNum=2229751#post2229751 and that this field is not seen as a date field, but actually as a hidden field. Can I change the field to another format without causing havoc elsewhere?

Cheers,

Cheers,

Tim (toledoh.com.au)

Hi Tim,

This is only possible by making changes to core CMS Builder files, which we don't recommend, and we can't provide any support for any issues that arise from the changes.

If you open the schema file for the section you want to be able to search the createdDate field of in cmsAdmin/data/schema/ directory, you should see an array entry for the createdDate that looks like this:

   'createdDate' => array(
    'order' => 2,
    'type' => 'none',
    'label' => 'Created',
    'isSystemField' => '1',
  ),

you need to modify it to look like this:

  'createdDate' => array(
    'order' => 2,
    'type' => 'date',
    'label' => 'Created',
    'isSystemField' => '1',
    'isUnique' => '0',
    'showTime' => '0',
    'showSeconds' => '0',
    'use24HourFormat' => '0',
    'yearRangeStart' => '2008',
    'yearRangeEnd' => '2016',
  ),

This will convert the createdDate to a visible field in the section, but will also allow users to easily filter on it with the date picker in the advanced search. If they try and change the value of it while creating/editing a record, CMS Builder will ignore the changes. 

Let me know if you have any questions.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com