#19370 closed Bug (fixed)
date filter returns empty string for midnight
Reported by: | Danilo Bargen | Owned by: | nobody |
---|---|---|---|
Component: | Template system | Version: | 1.4 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
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.
I'll post a pull request with the fix on Github in a short while.
Change History (4)
comment:1 by , 12 years ago
Has patch: | set |
---|
comment:2 by , 12 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
comment:3 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Pull request is here: https://github.com/django/django/pull/558
This is already fixed in the
|time
filter, but not in the|date
filter which can also be used to format times.Regression tests are provided.