summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2011-05-17 10:16:12 +0000
committerJannis Leidel <jannis@leidel.info>2011-05-17 10:16:12 +0000
commit578a31fea3cb439f6bfeeb7825ac835820a9f58c (patch)
treed900f07487179adabeb43da6a1b5cafdab003685 /docs
parent9ad005ec1c50e254dd61bbb1760c524aa01a79e2 (diff)
Fixed #15921 -- Refined naturaltime filter added in r16071 to use timesince and timeuntil filters as fallbacks instead of date filter.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16233 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/humanize.txt15
1 files changed, 9 insertions, 6 deletions
diff --git a/docs/ref/contrib/humanize.txt b/docs/ref/contrib/humanize.txt
index 5cacf2b97d..2f544c7ef7 100644
--- a/docs/ref/contrib/humanize.txt
+++ b/docs/ref/contrib/humanize.txt
@@ -104,9 +104,8 @@ naturaltime
For datetime values, returns a string representing how many seconds,
minutes or hours ago it was -- falling back to a longer date format if the
-value is more than a day old.
-
-**Argument:** Date formatting string as described in the :tfilter:`date` tag.
+value is more than a day old. In case the datetime value is in the future
+the return value will automatically use an appropriate phrase.
Examples (when 'now' is 17 Feb 2007 16:30:00):
@@ -116,9 +115,13 @@ Examples (when 'now' is 17 Feb 2007 16:30:00):
* ``17 Feb 2007 16:25:35`` becomes ``4 minutes ago``.
* ``17 Feb 2007 15:30:29`` becomes ``an hour 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.
+ * ``16 Feb 2007 13:31:29`` becomes ``1 day ago``.
+ * ``17 Feb 2007 16:30:30`` becomes ``29 seconds from now``.
+ * ``17 Feb 2007 16:31:00`` becomes ``a minute from now``.
+ * ``17 Feb 2007 16:34:35`` becomes ``4 minutes from now``.
+ * ``17 Feb 2007 16:30:29`` becomes ``an hour from now``.
+ * ``17 Feb 2007 18:31:29`` becomes ``2 hours from now``.
+ * ``18 Feb 2007 16:31:29`` becomes ``1 day from now``.
.. templatefilter:: ordinal