Skip to content
Snippets Groups Projects
Commit 256db02a authored by Monish Deb's avatar Monish Deb
Browse files

#2774 : Sort by date column on multirecord field listing section on...

#2774 : Sort by date column on multirecord field listing section on profile edit mode doesn't work
parent e8a784a3
Branches
Tags
No related merge requests found
......@@ -307,7 +307,12 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic {
$customValue = &$val;
if (!empty($dateFields) && array_key_exists($fieldId, $dateFields)) {
// formatted date capture value capture
$dateFieldsVals[$fieldId][$recId] = CRM_Core_BAO_CustomField::displayValue($customValue, $fieldId);
if ($this->_pageViewType == 'profileDataView') {
$dateFieldsVals[$fieldId][$recId] = CRM_Utils_Date::processDate($result[$recId][$fieldId], NULL, FALSE, 'YmdHis');
}
else {
$dateFieldsVals[$fieldId][$recId] = CRM_Core_BAO_CustomField::displayValue($customValue, $fieldId);
}
//set date and time format
switch ($timeFormat) {
......
......@@ -75,7 +75,7 @@
{foreach from=$records key=recId item=rows}
<tr class="{cycle values="odd-row,even-row"}">
{foreach from=$headers key=hrecId item=head}
<td {crmAttributes a=$attributes.$hrecId.$recId}>{$rows.$hrecId}</td>
<td {if !empty($dateFieldsVals.$hrecId)}data-order="{$dateFieldsVals.$hrecId.$recId|crmDate:'%Y-%m-%d'}"{/if} {crmAttributes a=$attributes.$hrecId.$recId}>{$rows.$hrecId}</td>
{/foreach}
<td>{$rows.action}</td>
{foreach from=$dateFieldsVals key=fid item=rec}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment