misc: add support for more datetime formats (#20203) #915
|
@ -2824,6 +2824,18 @@ def test_lazy_date_templatetags(pub, variable_test_data):
|
|||
assert condition.evaluate() is True
|
||||
condition = Condition({'type': 'django', 'value': '"2017-10-11 01:00"|datetime|date == "2017-10-11"'})
|
||||
assert condition.evaluate() is True
|
||||
condition = Condition(
|
||||
{'type': 'django', 'value': '"2018-09-30T00:00:00.000+02:00"|datetime|date == "2018-09-30"'}
|
||||
)
|
||||
assert condition.evaluate() is True
|
||||
condition = Condition(
|
||||
{'type': 'django', 'value': '"2018-09-30T00:00:00+02:00"|datetime|date == "2018-09-30"'}
|
||||
)
|
||||
assert condition.evaluate() is True
|
||||
condition = Condition(
|
||||
{'type': 'django', 'value': '"2018-09-30T00:00:00.000"|datetime|date == "2018-09-30"'}
|
||||
)
|
||||
assert condition.evaluate() is True
|
||||
|
||||
condition = Condition({'type': 'django', 'value': 'now|date == today'})
|
||||
assert condition.evaluate() is True
|
||||
|
|
|
@ -230,6 +230,9 @@ DATETIME_FORMATS = {
|
|||
'%Y-%m-%dT%H:%M:%SZ',
|
||||
'%y-%m-%d %H:%M',
|
||||
'%y-%m-%d %H:%M:%S',
|
||||
'%Y-%m-%dT%H:%M:%S%z',
|
||||
'%y-%m-%d %H:%M:%S.%f',
|
||||
'%Y-%m-%dT%H:%M:%S.%f%z',
|
||||
],
|
||||
'fr': [
|
||||
'%d/%m/%Y %H:%M',
|
||||
|
|
Loading…
Reference in New Issue