Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
4229989c
Unverified
Commit
4229989c
authored
4 years ago
by
Eileen McNaughton
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #17512 from semseysandor/relative-date-filter
#1798
- "End of yesterday" Relative Date Filter
parents
63155d32
eb2fe97a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CRM/Utils/Date.php
+1
-0
1 addition, 0 deletions
CRM/Utils/Date.php
tests/phpunit/CRM/Utils/DateTest.php
+12
-0
12 additions, 0 deletions
tests/phpunit/CRM/Utils/DateTest.php
with
13 additions
and
0 deletions
CRM/Utils/Date.php
+
1
−
0
View file @
4229989c
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
tests/phpunit/CRM/Utils/DateTest.php
+
12
−
0
View file @
4229989c
...
...
@@ -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
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment