I have a template tag which returns datetime objects converted to the user’s timezone. To format it, I’d prefer the builtin filter “date” to format it.
Is it possible to use a filter on the result of a template tag?
I have a template tag which returns datetime objects converted to the user’s timezone.
Share
Yes, if course you can. Filters are just functions that can be imported. Import the filter function you need from django.template.defaultfilters and pass your arguments to it.