Closed WesleyAC closed 6 months ago
Can you be more specific of what the ask is? The filter already supports custom date formatting, but it uses a different format than strftime
.
Yeah — I was looking at the minijinja_contrib filters which support formats like short
/medium
/long
/full
/iso
/unix
, but don't allow fully custom formatting. Looking at the built-in filters I don't see any relating to time formatting.
What function should I be looking for that does custom date formatting?
@WesleyAC they support any of the formats from the time crate. So you can do this:
{{ foo|dateformat(format="[weekday], [month repr:long] [day padding:none] [year]") }}
Is this format documented anywhere?
@WesleyAC yes, it's documented in the time crate: https://time-rs.github.io/book/api/format-description.html
It would be great to use custom strftime style format string with
dateformat
and the other time/date functions, or perhaps more cleanly, just make astrftime
filter.