*/
static function displayProfile(&$params, $gid, &$groupTitle, &$values, &$profileFields = array()) {
if ($gid) {
+ $config = CRM_Core_Config::singleton();
$session = CRM_Core_Session::singleton();
$contactID = $session->get('userID');
if ($contactID) {
}
}
elseif ('date' == substr($name, -4)) {
- $values[$index] = $params[$name];
+ $values[$index] = CRM_Utils_Date::customFormat(CRM_Utils_Date::processDate($params[$name]),
+ $config->dateformatFull);
}
elseif ('country' == substr($name, 0, 7)) {
if ($params[$name]) {
else {
if ($cfID = CRM_Core_BAO_CustomField::getKeyID($name)) {
$query = "
-SELECT html_type, data_type
+SELECT html_type, data_type, date_format, time_format
FROM civicrm_custom_field
WHERE id = $cfID
";
$dao = CRM_Core_DAO::executeQuery($query);
$dao->fetch();
$htmlType = $dao->html_type;
- $dataType = $dao->data_type;
if ($htmlType == 'File') {
- //$fileURL = CRM_Core_BAO_CustomField::getFileURL( $contactID, $cfID );
- //$params[$index] = $values[$index] = $fileURL['file_url'];
$values[$index] = $params[$index];
}
else {
$customVal = (float )($params[$name]);
}
elseif ($dao->data_type == 'Date') {
- $customVal = $displayValue = $params[$name];
+ $customVal = $displayValue = CRM_Utils_Date::customFormat(
+ CRM_Utils_Date::processDate($params[$name]), $config->dateformatFull);
+
if (!empty($params[$name . '_time'])) {
- $customVal = $displayValue = $params[$name] . ' ' . $params[$name . '_time'];
+ $customVal = $displayValue = CRM_Utils_Date::customFormat(
+ CRM_Utils_Date::processDate($params[$name], $params[$name . '_time']),
+ $config->dateformatDateTime);
}
$skip = TRUE;
}