CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Best way to put a datetime field into a custom search to filter by time of day
Pages: [1]

Author Topic: Best way to put a datetime field into a custom search to filter by time of day  (Read 303 times)

Sean Madsen

  • I post occasionally
  • **
  • Posts: 98
  • Karma: 5
  • CiviCRM implementer/developer
    • Bikes Not Bombs
  • CiviCRM version: 4.6
  • CMS version: Drupal 7
Best way to put a datetime field into a custom search to filter by time of day
May 06, 2014, 10:36:33 am
I'm making a custom search where I need to have the user enter a date range, including time of day. What is the best way to do this? Ideally the interface would look similar to other Civi forms that ask for a date and associated time of day. I'm adding the date fields to my search form like this:

$form->addDate('start_date', ts('Start Date'), FALSE, array('formatType' => 'custom'));
$form->addDate('end_date', ts('End Date'), FALSE, array('formatType' => 'custom'));

What can I change to get times in there as well?

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Best way to put a datetime field into a custom search to filter by time of day

This forum was archived on 2017-11-26.