Fix for ticket 19370 (date filter returns empty string for midnight) #558

wants to merge 1 commit into


None yet

2 participants

dbrgn commented Nov 27, 2012

Ticket 19370:

Python considers midnight (datetime.time(0, 0)) to be False. The date template filter stumbles over this.

When using {{ midnight|date:"H:i" }}, Django returns an empty string.

See ​ for discussion about the bug.

This is already fixed in the |time filter, but not in the |date filter which can also be used to format times.

claudep commented Nov 27, 2012

Thanks, committed in c10aaa7 (master) and 5509eb8 (1.5.x)

@claudep claudep closed this Nov 27, 2012
@dbrgn dbrgn deleted the dbrgn:ticket_19370 branch Oct 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment