Skip to content

Commit

Permalink
Fix participant mails
Browse files Browse the repository at this point in the history
  • Loading branch information
Jitendra Purohit committed Jul 21, 2017
1 parent 6c08198 commit c65ec45
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CRM/Core/BAO/CustomField.php
Original file line number Diff line number Diff line change
Expand Up @@ -1234,8 +1234,8 @@ private static function formatDisplayValue($value, $field, $entityId = NULL) {
break;

default:
// if time is not selected remove time from value
$value = substr($value, 0, 10);
//If time is not selected remove time from value.
$value = $value ? date('Y-m-d', strtotime($value)) : '';
}
$customFormat = implode(" ", $customTimeFormat);
}
Expand Down
4 changes: 4 additions & 0 deletions tests/phpunit/CRM/Core/BAO/CustomQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ public function testSearchCustomDataDateFromTo() {
$queryObj->_where[0][0]
);
$this->assertEquals($queryObj->_qill[0][0], "date field BETWEEN 'June 6th, 2014 12:00 AM AND June 6th, 2015 11:59 PM'");

//CRM-17236 - Test custom date is correctly displayed without time.
$formattedValue = CRM_Core_BAO_CustomField::displayValue(date('Ymdhms'), $dateCustomField['id']);
$this->assertEquals(date('m/d/Y'), $formattedValue);
}

/**
Expand Down

0 comments on commit c65ec45

Please sign in to comment.