Reputation: 6805
I found a directory called template tags in the django repo, but I do not see the template tags I'm looking for. Specifically, this one:
{{ testdate | date:'m-d-Y, H:i a' }}
Upvotes: 1
Views: 82
Reputation: 1204
The source code you are looking for,
@register.filter(expects_localtime=True, is_safe=False)
def date(value, arg=None):
"""Format a date according to the given format."""
if value in (None, ''):
return ''
try:
return formats.date_format(value, arg)
except AttributeError:
try:
return format(value, arg)
except AttributeError:
return ''
You can find them in the defaultfilters.py file.
django -> django -> template -> defaultfilters.py
Upvotes: 3