From: Eileen McNaughton Date: Thu, 26 Mar 2015 02:49:04 +0000 (+1300) Subject: CRM-16183 Report datetime fields: display as datetime if specified as datetime (not... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=908a11e71b8c37dfa09b6636a07561279629aa0b;p=civicrm-core.git CRM-16183 Report datetime fields: display as datetime if specified as datetime (not date) --- diff --git a/CRM/Report/Utils/Report.php b/CRM/Report/Utils/Report.php index 94667f7dae..120fd13c00 100644 --- a/CRM/Report/Utils/Report.php +++ b/CRM/Report/Utils/Report.php @@ -272,6 +272,10 @@ WHERE inst.report_id = %1"; elseif (CRM_Utils_Array::value('group_by', $form->_columnHeaders[$v]) == 'YEAR') { $value = CRM_Utils_Date::customFormat($value, $config->dateformatYear); } + elseif ($form->_columnHeaders[$v]['type'] == 12) { + // This is a datetime format + $value = CRM_Utils_Date::customFormat($value, '%Y-%m-%d %H:%i'); + } else { $value = CRM_Utils_Date::customFormat($value, '%Y-%m-%d'); } diff --git a/templates/CRM/Report/Form/Layout/Overlay.tpl b/templates/CRM/Report/Form/Layout/Overlay.tpl index 8013a49be1..f20db9867d 100644 --- a/templates/CRM/Report/Form/Layout/Overlay.tpl +++ b/templates/CRM/Report/Form/Layout/Overlay.tpl @@ -110,7 +110,7 @@ {elseif $header.group_by eq 'YEAR'} {$row.$field|crmDate:$config->dateformatYear} {else} - {if $header.type & 4} + {if $header.type == 4} {$row.$field|truncate:10:''|crmDate} {else} {$row.$field|crmDate} diff --git a/templates/CRM/Report/Form/Layout/Table.tpl b/templates/CRM/Report/Form/Layout/Table.tpl index 37ffd0b8e9..d9abe61d0b 100644 --- a/templates/CRM/Report/Form/Layout/Table.tpl +++ b/templates/CRM/Report/Form/Layout/Table.tpl @@ -112,7 +112,7 @@ {elseif $header.group_by eq 'YEAR'} {$row.$field|crmDate:$config->dateformatYear} {else} - {if $header.type & 4} + {if $header.type == 4} {$row.$field|truncate:10:''|crmDate} {else} {$row.$field|crmDate}