Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
close #78
Addition of a "maxdiff" filter (I had no idea to name it, if you have a better name, let me know) to limit the Date difference to display the "ago" format.
I made that PR quickly because I wanted to have that behaviour in an app and had no idea how to do that in twig only and i saw a related issue.
It's one of my first PR for an open source project, so if there's any problem with the PR (code or this description), let me know.
Examples:
(in french, sorry. For non-french, It says "5 hours ago")
with the code
{{ chapter.publishedAt|diffmax(15, 'd/m/Y', 'hour')|ago }}
(The filters order doesn't seem to matter)(The filter order matter, thediffmax
HAVE TO be prior theago
one)