mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #8683: html_last_updated_fmt generates wrong time zone for %Z
sphinx.util.i18n:format_date() converts '%Z' to full name of time zone unexpectedly. It should be converted to short name.
This commit is contained in:
parent
d5559e1ba2
commit
8ff8b5532c
1
CHANGES
1
CHANGES
@ -51,6 +51,7 @@ Bugs fixed
|
|||||||
* #8341: C, fix intersphinx lookup types for names in declarations.
|
* #8341: C, fix intersphinx lookup types for names in declarations.
|
||||||
* C, C++: in general fix intersphinx and role lookup types.
|
* C, C++: in general fix intersphinx and role lookup types.
|
||||||
* #8683: :confval:`html_last_updated_fmt` does not support UTC offset (%z)
|
* #8683: :confval:`html_last_updated_fmt` does not support UTC offset (%z)
|
||||||
|
* #8683: :confval:`html_last_updated_fmt` generates wrong time zone for %Z
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
@ -236,7 +236,7 @@ date_format_mappings = {
|
|||||||
'%X': 'medium', # Locale’s appropriate time representation.
|
'%X': 'medium', # Locale’s appropriate time representation.
|
||||||
'%y': 'YY', # Year without century as a zero-padded decimal number.
|
'%y': 'YY', # Year without century as a zero-padded decimal number.
|
||||||
'%Y': 'yyyy', # Year with century as a decimal number.
|
'%Y': 'yyyy', # Year with century as a decimal number.
|
||||||
'%Z': 'zzzz', # Time zone name (no characters if no time zone exists).
|
'%Z': 'zzz', # Time zone name (no characters if no time zone exists).
|
||||||
'%z': 'ZZZ', # UTC offset in the form ±HHMM[SS[.ffffff]]
|
'%z': 'ZZZ', # UTC offset in the form ±HHMM[SS[.ffffff]]
|
||||||
# (empty string if the object is naive).
|
# (empty string if the object is naive).
|
||||||
'%%': '%',
|
'%%': '%',
|
||||||
|
@ -88,6 +88,8 @@ def test_format_date():
|
|||||||
assert i18n.format_date(format, date=date) == 'Feb 7, 2016'
|
assert i18n.format_date(format, date=date) == 'Feb 7, 2016'
|
||||||
|
|
||||||
# timezone
|
# timezone
|
||||||
|
format = '%Z'
|
||||||
|
assert i18n.format_date(format, date=datet) == 'UTC'
|
||||||
format = '%z'
|
format = '%z'
|
||||||
assert i18n.format_date(format, date=datet) == '+0000'
|
assert i18n.format_date(format, date=datet) == '+0000'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user