mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	Backport of 6585ebebaa from master
			
			
This commit is contained in:
		| @@ -1470,12 +1470,18 @@ for example, ``"es"``, then for:: | |||||||
| the output would be the string ``"09/01/2008"`` (the ``"SHORT_DATE_FORMAT"`` | the output would be the string ``"09/01/2008"`` (the ``"SHORT_DATE_FORMAT"`` | ||||||
| format specifier for the ``es`` locale as shipped with Django is ``"d/m/Y"``). | format specifier for the ``es`` locale as shipped with Django is ``"d/m/Y"``). | ||||||
|  |  | ||||||
| When used without a format string:: | When used without a format string, the ``DATE_FORMAT`` format specifier is | ||||||
|  | used. Assuming the same settings as the previous example:: | ||||||
|  |  | ||||||
|     {{ value|date }} |     {{ value|date }} | ||||||
|  |  | ||||||
| ...the formatting string defined in the :setting:`DATE_FORMAT` setting will be | outputs ``9 de Enero de 2008`` (the ``DATE_FORMAT`` format specifier for the | ||||||
| used, without applying any localization. | ``es`` locale is ``r'j \d\e F \d\e Y'``. | ||||||
|  |  | ||||||
|  | .. versionchanged:: 1.10 | ||||||
|  |  | ||||||
|  |     In older versions, the :setting:`DATE_FORMAT` setting (without | ||||||
|  |     localization) is always used when a format string isn't given. | ||||||
|  |  | ||||||
| You can combine ``date`` with the :tfilter:`time` filter to render a full | You can combine ``date`` with the :tfilter:`time` filter to render a full | ||||||
| representation of a ``datetime`` value. E.g.:: | representation of a ``datetime`` value. E.g.:: | ||||||
| @@ -2196,12 +2202,19 @@ attached timezone information (a :ref:`time-zone-aware | |||||||
| accept the timezone-related :ref:`format specifiers | accept the timezone-related :ref:`format specifiers | ||||||
| <date-and-time-formatting-specifiers>` ``'e'``, ``'O'`` , ``'T'`` and ``'Z'``. | <date-and-time-formatting-specifiers>` ``'e'``, ``'O'`` , ``'T'`` and ``'Z'``. | ||||||
|  |  | ||||||
| When used without a format string:: | When used without a format string, the ``TIME_FORMAT`` format specifier is | ||||||
|  | used:: | ||||||
|  |  | ||||||
|     {{ value|time }} |     {{ value|time }} | ||||||
|  |  | ||||||
| ...the formatting string defined in the :setting:`TIME_FORMAT` setting will be | is the same as:: | ||||||
| used, without applying any localization. |  | ||||||
|  |     {{ value|time:"TIME_FORMAT" }} | ||||||
|  |  | ||||||
|  | .. versionchanged:: 1.10 | ||||||
|  |  | ||||||
|  |     In older versions, the :setting:`TIME_FORMAT` setting (without | ||||||
|  |     localization) is always used when a format string isn't given. | ||||||
|  |  | ||||||
| .. templatefilter:: timesince | .. templatefilter:: timesince | ||||||
|  |  | ||||||
|   | |||||||
| @@ -919,6 +919,11 @@ Miscellaneous | |||||||
|   To adapt, move the fragment outside the template tag: |   To adapt, move the fragment outside the template tag: | ||||||
|   ``{% static 'img.svg' %}#fragment``. |   ``{% static 'img.svg' %}#fragment``. | ||||||
|  |  | ||||||
|  | * When :setting:`USE_L10N` is ``True``, localization is now applied for the | ||||||
|  |   :tfilter:`date` and :tfilter:`time` filters when no format string is | ||||||
|  |   specified. The ``DATE_FORMAT`` and ``TIME_FORMAT`` specifiers from the active | ||||||
|  |   locale are used instead of the settings of the same name. | ||||||
|  |  | ||||||
| .. _deprecated-features-1.10: | .. _deprecated-features-1.10: | ||||||
|  |  | ||||||
| Features deprecated in 1.10 | Features deprecated in 1.10 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user