Fix ordinal filter in template (#18878)
This commit is contained in:
1 parent
c69fe43e75
commit
558504c686
1 file changed
+3
-2
@@ -616,8 +616,9 @@ def base64_decode(value):
|
||||
def ordinal(value):
|
||||
"""Perform ordinal conversion."""
|
||||
return str(value) + (list(['th', 'st', 'nd', 'rd'] + ['th'] * 6)
|
||||
[(int(str(value)[-1])) % 10] if not
|
||||
int(str(value)[-2:]) % 100 in range(11, 14) else 'th')
|
||||
[(int(str(value)[-1])) % 10] if
|
||||
int(str(value)[-2:]) % 100 not in range(11, 14)
|
||||
else 'th')
|
||||
|
||||
|
||||
@contextfilter
|
||||
|
||||
Reference in new issue
Block a user