mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Test for ISO dates
This commit is contained in:
parent
09556dd880
commit
cb0d6f8dd0
2 changed files with 4 additions and 0 deletions
|
|
@ -513,6 +513,9 @@ class TestUtils(LoggedTestCase):
|
|||
d = utils.SafeDatetime(2012, 8, 9)
|
||||
self.assertEqual(utils.strftime(d, '%-d/%-m/%y'), '9/8/12')
|
||||
|
||||
d = utils.SafeDatetime(2021, 1, 8)
|
||||
self.assertEqual(utils.strftime(d, '%G - %-V - %u'), '2021 - 1 - 5')
|
||||
|
||||
# test the output of utils.strftime in a different locale
|
||||
# Turkish locale
|
||||
@unittest.skipUnless(locale_available('tr_TR.UTF-8') or
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ class SafeDatetime(datetime.datetime):
|
|||
else:
|
||||
return super().strftime(fmt)
|
||||
|
||||
|
||||
class DateFormatter:
|
||||
'''A date formatter object used as a jinja filter
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue