Commit 28e77356 authored by jaapjansma's avatar jaapjansma
Browse files

translate date custom values

parent 20dc277f
......@@ -28,7 +28,15 @@ function activitytokens_evaluate_tokens(\Civi\Token\Event\TokenValueEvent $e) {
foreach ($activity as $field => $value) {
if (stripos($field, 'custom_') === 0) {
$customFieldID = substr($field, 7);
$value = \CRM_Core_BAO_CustomField::displayValue($value, $customFieldID);
$field = \CRM_Core_BAO_CustomField::getFieldObject($customFieldID);
// Use the \CRM_Utils_Date::format for date fields
// because the displayValue is not translated.
if ($field->html_type == 'Select Date') {
$value = \CRM_Utils_Date::format($value);
} else {
$value = \CRM_Core_BAO_CustomField::displayValue($value, $field);
}
$row->tokens(CRM_ActivityTokens_Tokens::TOKEN, $field, $value);
}
}
......
......@@ -13,8 +13,8 @@
<url desc="Documentation">https://lab.civicrm.org/extensions/activitytokens/README.md</url>
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2019-06-19</releaseDate>
<version>1.2</version>
<releaseDate>2019-06-21</releaseDate>
<version>1.3</version>
<develStage>stable</develStage>
<compatibility>
<ver>5.0</ver>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment