Skip to content

Commit

Permalink
CRM-21148 revert back to odd handling when NULL passed to getFromTo, …
Browse files Browse the repository at this point in the history
…deprecate
  • Loading branch information
eileenmcnaughton committed Apr 16, 2018
1 parent 7ec58d2 commit 5e9221b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CRM/Report/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -2056,6 +2056,8 @@ public function dateClause(
/**
* Get values for from and to for date ranges.
*
* @deprecated
*
* @param bool $relative
* @param string $from
* @param string $to
Expand All @@ -2064,7 +2066,13 @@ public function dateClause(
*
* @return array
*/
public function getFromTo($relative, $from, $to, $fromTime = NULL, $toTime = '235959') {
public function getFromTo($relative, $from, $to, $fromTime = NULL, $toTime = NULL) {
if (empty($toTime)) {
// odd legacy behaviour to treat NULL as 'end of the day'
// recommend updating reports to call CRM_Utils_Date::getFromTo
//directly (default on the function is the actual default there).
$toTime = '235959';
}
return CRM_Utils_Date::getFromTo($relative, $from, $to, $fromTime, $toTime);
}

Expand Down

0 comments on commit 5e9221b

Please sign in to comment.