diff options
| author | Marc Garcia <garcia.marc@gmail.com> | 2009-07-13 15:19:05 +0000 |
|---|---|---|
| committer | Marc Garcia <garcia.marc@gmail.com> | 2009-07-13 15:19:05 +0000 |
| commit | c52ae07453a5556ba255aa115f2a4e8f56c7fd73 (patch) | |
| tree | b10f8638f065e66d9960a3e3af1cf557e8dd1a38 /docs/ref | |
| parent | 0f205b9987d6ac18105d5db05a280a16fb194371 (diff) | |
[soc2009/i18n] Date filter allowed to use predefined formats, improved fallbacks on getting formats, and documentation added.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/i18n-improvements@11231 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/templates/builtins.txt | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index 32b5984767..ba45a6f1c4 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -870,7 +870,11 @@ If ``value`` is ``"String with spaces"``, the output will be ``"Stringwithspaces date ~~~~ -Formats a date according to the given format (same as the `now`_ tag). +Formats a date according to the given format. + +Given format can be one of the predefined ones ``DATE_FORMAT``, ``DATETIME_FORMAT``, +``SHORT_DATE_FORMAT`` or ``SHORT_DATETIME_FORMAT``, or a custom format, same as the +`now`_ tag. Note that prefedined formats vary depending on the current locale. For example:: @@ -885,7 +889,7 @@ When used without a format string:: {{ value|date }} ...the formatting string defined in the :setting:`DATE_FORMAT` setting will be -used. +used, without applying any localization. .. templatefilter:: default @@ -1433,7 +1437,10 @@ output will be ``"Joel is a slug"``. time ~~~~ -Formats a time according to the given format (same as the `now`_ tag). +Formats a time according to the given format. + +Given format can be the predefined one ``TIME_FORMAT``, or a custom format, same as the `now`_ tag. Note that the predefined format is locale depending. + The time filter will only accept parameters in the format string that relate to the time of day, not the date (for obvious reasons). If you need to format a date, use the `date`_ filter. @@ -1450,7 +1457,7 @@ When used without a format string:: {{ value|time }} ...the formatting string defined in the :setting:`TIME_FORMAT` setting will be -used. +used, without aplying any localization. .. templatefilter:: timesince |
