1
0
mirror of https://github.com/django/django.git synced 2025-10-30 17:16:10 +00:00

Fixed #19370 -- Made date filter properly handle midnight value

This commit is contained in:
Danilo Bargen
2012-11-27 21:22:18 +01:00
committed by Claude Paroz
parent d37483c533
commit c10aaa70a4
2 changed files with 5 additions and 2 deletions

View File

@@ -704,7 +704,7 @@ def get_digit(value, arg):
@register.filter(expects_localtime=True, is_safe=False)
def date(value, arg=None):
"""Formats a date according to the given format."""
if not value:
if value in (None, ''):
return ''
if arg is None:
arg = settings.DATE_FORMAT