Skip to content

Commit

Permalink
Improve doctest for DateTimeFormat.format_period
Browse files Browse the repository at this point in the history
  • Loading branch information
jun66j5 committed May 10, 2022
1 parent cf1abf1 commit 38a0e42
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions babel/dates.py
Expand Up @@ -1456,23 +1456,23 @@ def format_period(self, char, num):
"""
Return period from parsed datetime according to format pattern.
>>> format = DateTimeFormat(time(19, 42), 'en_US')
>>> format = DateTimeFormat(time(13, 42), 'fi_FI')
>>> format.format_period('a', 1)
u'PM'
u'ip.'
>>> format.format_period('b', 1)
u'evening'
>>> format.format_period('B', 1)
u'in the evening'
u'iltap.'
>>> format.format_period('b', 4)
u'iltapäivä'
>>> format.format_period('B', 4)
u'iltapäivällä'
>>> format.format_period('B', 5)
u'ip.'
>>> format = DateTimeFormat(datetime(2022, 4, 28, 6, 27), 'zh_Hant')
>>> format.format_period('a', 1)
u'上午'
>>> format.format_period('b', 1)
u'清晨'
>>> format.format_period('B', 1)
u'清晨'
Expand Down

0 comments on commit 38a0e42

Please sign in to comment.