From 908a11e71b8c37dfa09b6636a07561279629aa0b Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 26 Mar 2015 15:49:04 +1300 Subject: [PATCH] CRM-16183 Report datetime fields: display as datetime if specified as datetime (not date) --- CRM/Report/Utils/Report.php | 4 ++++ templates/CRM/Report/Form/Layout/Overlay.tpl | 2 +- templates/CRM/Report/Form/Layout/Table.tpl | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) 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} -- 2.25.1