summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/contrib/humanize.txt25
1 files changed, 25 insertions, 0 deletions
diff --git a/docs/ref/contrib/humanize.txt b/docs/ref/contrib/humanize.txt
index ef48f48fcc..f7afb9c5e8 100644
--- a/docs/ref/contrib/humanize.txt
+++ b/docs/ref/contrib/humanize.txt
@@ -82,6 +82,31 @@ Examples (when 'today' is 17 Feb 2007):
* Any other day is formatted according to given argument or the
:setting:`DATE_FORMAT` setting if no argument is given.
+.. templatefilter:: naturaltime
+
+naturaltime
+-----------
+
+.. versionadded:: 1.4
+
+For date and time values shows how many seconds, minutes or hours ago compared
+to current timestamp returns representing string. Otherwise, it behaves like
+:tfilter:`naturaldate`, so it can also take string argument for date formating.
+
+**Argument:** Date formatting string as described in the :tfilter:`date` tag.
+
+Examples (when 'now' is 17 Feb 2007 16:30:00):
+
+ * ``17 Feb 2007 16:30:00`` becomes ``now``.
+ * ``17 Feb 2007 16:29:31`` becomes ``29 seconds ago``.
+ * ``17 Feb 2007 16:29:00`` becomes ``a minute ago``.
+ * ``17 Feb 2007 16:25:35`` becomes ``4 minutes ago``.
+ * ``17 Feb 2007 15:30:29`` becomes ``an hours ago``.
+ * ``17 Feb 2007 13:31:29`` becomes ``2 hours ago``.
+ * ``16 Feb 2007 13:31:29`` becomes ``yesterday``.
+ * Any other day is formatted according to given argument or the
+ :setting:`DATE_FORMAT` setting if no argument is given.
+
.. templatefilter:: ordinal
ordinal