Fixed #3311 -- Added naturalday filter to contrib.humanize. Thanks, Jyrki Pulliainen.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5985 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2007-08-20 08:50:08 +00:00
parent b367ec2244
commit 14b5e074ba
4 changed files with 70 additions and 3 deletions

View file

@ -138,6 +138,29 @@ Examples:
You can pass in either an integer or a string representation of an integer.
naturalday
----------
**New in Django development version**
For dates that are the current day or within one day, return "today",
"tomorrow" or "yesterday", as appropriate. Otherwise, format the date using
the passed in format string.
**Argument:** Date formatting string as described in default tag now_.
.. _now: ../templates/#now
Examples (when 'today' is 17 Feb 2007):
* ``16 Feb 2007`` becomes ``yesterday``.
* ``17 Feb 2007`` becomes ``today``.
* ``18 Feb 2007`` becomes ``tomorrow``.
* Any other day is formatted according to given argument or the
`DATE_FORMAT`_ setting if no argument is given.
.. _DATE_FORMAT: ../settings/#date_format
flatpages
=========