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

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@dbrgn
dbrgn commented Nov 27, 2012

Ticket 19370: https://code.djangoproject.com/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 ​http://bugs.python.org/issue13936 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
Member
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