CRM-16183 Report datetime fields: display as datetime if specified as datetime (not...
authorEileen McNaughton <eileen@fuzion.co.nz>
Thu, 26 Mar 2015 02:49:04 +0000 (15:49 +1300)
committerEileen McNaughton <eileen@fuzion.co.nz>
Thu, 26 Mar 2015 04:02:50 +0000 (17:02 +1300)
CRM/Report/Utils/Report.php
templates/CRM/Report/Form/Layout/Overlay.tpl
templates/CRM/Report/Form/Layout/Table.tpl

index 94667f7daea9d5a5743914099b2a67a3d2f98ab7..120fd13c00cce9180aae59afeb2c8cc7503caab2 100644 (file)
@@ -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');
             }
index 8013a49be15ac81347011e4754e76805ff26e580..f20db9867dc1cb2f432db982d3937ca5f1a6e7dd 100644 (file)
                             {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}
index 37ffd0b8e9ddd6ed51fe359f9203cb89d1c42c8c..d9abe61d0b818d276f2f21754081d8710b3e717d 100644 (file)
                             {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}