aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/twig/twig/doc/filters/date_modify.rst
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/twig/twig/doc/filters/date_modify.rst')
-rw-r--r--vendor/twig/twig/doc/filters/date_modify.rst23
1 files changed, 23 insertions, 0 deletions
diff --git a/vendor/twig/twig/doc/filters/date_modify.rst b/vendor/twig/twig/doc/filters/date_modify.rst
new file mode 100644
index 00000000..6a5c73d6
--- /dev/null
+++ b/vendor/twig/twig/doc/filters/date_modify.rst
@@ -0,0 +1,23 @@
1``date_modify``
2===============
3
4.. versionadded:: 1.9.0
5 The date_modify filter has been added in Twig 1.9.0.
6
7The ``date_modify`` filter modifies a date with a given modifier string:
8
9.. code-block:: jinja
10
11 {{ post.published_at|date_modify("+1 day")|date("m/d/Y") }}
12
13The ``date_modify`` filter accepts strings (it must be in a format supported
14by the `strtotime`_ function) or `DateTime`_ instances. You can easily combine
15it with the :doc:`date<date>` filter for formatting.
16
17Arguments
18---------
19
20 * ``modifier``: The modifier
21
22.. _`strtotime`: http://www.php.net/strtotime
23.. _`DateTime`: http://www.php.net/DateTime