Skip to content
Snippets Groups Projects
Commit 787c6413 authored by jaapjansma's avatar jaapjansma
Browse files

update

parent e8f119e0
Branches
Tags
No related merge requests found
......@@ -11,7 +11,8 @@ class CRM_CivirulesConditions_AgeComparison extends CRM_CivirulesConditions_Gene
protected function getFieldValue(CRM_Civirules_EventData_EventData $eventData) {
$birth_date = civicrm_api3('Contact', 'getvalue', array('id' => $eventData->getContactId(), 'return' => 'birth_date'));
if ($birth_date) {
return newDateTime($birth_date)->diff(new DateTime('now'))->y;
$birthDate = new DateTime($birth_date);
return $birthDate->diff(new DateTime('now'))->y;
}
return false; //undefined birth date
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment