Skip to content
Snippets Groups Projects
Unverified Commit 4229989c authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #17512 from semseysandor/relative-date-filter

#1798 - "End of yesterday" Relative Date Filter
parents 63155d32 eb2fe97a
Branches
Tags
No related merge requests found
......@@ -1822,6 +1822,7 @@ class CRM_Utils_Date {
$to['d'] = $now['mday'];
$to['M'] = $now['mon'];
$to['Y'] = $now['year'];
$to = self::intervalAdd('day', -1, $to);
unset($from);
break;
......
......@@ -304,4 +304,16 @@ class CRM_Utils_DateTest extends CiviUnitTestCase {
$this->assertEquals(CRM_Utils_Date::customFormatTs($ts, "%Y"), "2018");
}
/**
* Test Earlier Day Relative term to absolute
*/
public function testRelativeEarlierDay() {
$date = CRM_Utils_Date::relativeToAbsolute('earlier', 'day');
$this->assertEquals([
'from' => NULL,
'to' => date('Ymd000000', strtotime('-1 day')),
], $date);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment