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) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Showing Register Date/Time
Pages: [1]

Author Topic: Showing Register Date/Time  (Read 717 times)

bpmccain

  • I post frequently
  • ***
  • Posts: 255
  • Karma: 5
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.12
  • MySQL version: 5.2
  • PHP version: 5.2
Showing Register Date/Time
September 30, 2012, 10:12:47 am
The standard CiviEvent reports show Register Date as a field, but there is also a time stored in the DB. How would I get that time to show on the report. Would it be using alterDisplay? And if so, how? I am new to this part of civiReport.

Thanks.

Brian

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: Showing Register Date/Time
October 01, 2012, 04:16:15 am
'type' parameter if not specified in case of date fields, is assumed to be just date and not date time.

Solution is to specify the 'type' parameter as date-time which can be done as :

Code: [Select]
Index: CRM/Report/Form/Event/ParticipantListing.php
===================================================================
--- CRM/Report/Form/Event/ParticipantListing.php (revision 42622)
+++ CRM/Report/Form/Event/ParticipantListing.php (working copy)
@@ -139,7 +139,8 @@
           ),
           'participant_fee_level' => NULL,
           'participant_fee_amount' => NULL,
-          'participant_register_date' => array('title' => ts('Registration Date')),
+          'participant_register_date' => array('title' => ts('Registration Date'),
+                                               'type'  =>  CRM_Utils_Type::T_TIMESTAMP),


You could also specify CRM_Utils_Type::T_TIME, but CRM_Utils_Type::T_TIMESTAMP is good with formatting.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

bpmccain

  • I post frequently
  • ***
  • Posts: 255
  • Karma: 5
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.12
  • MySQL version: 5.2
  • PHP version: 5.2
Re: Showing Register Date/Time
October 01, 2012, 09:23:29 am
You are my saviour. Thank you.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Showing Register Date/Time

This forum was archived on 2017-11-26.