summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2006-08-12 05:09:12 +0000
committerAdrian Holovaty <adrian@holovaty.com>2006-08-12 05:09:12 +0000
commit74f5d2b9b0c37e4ccbd5f303c4ab3d6400a95c59 (patch)
treeaa59609d7081df39bde716ebfe54159588284a52 /django
parent6f8e9be24a0c7208ebd6a3c72ec622ca02d6fc09 (diff)
Fixed #2528 -- Fixed 'time' template filter for midnight time value. Thanks, django@dougma.com
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3563 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/template/defaultfilters.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py
index c75f371ec8..a2e9d2f405 100644
--- a/django/template/defaultfilters.py
+++ b/django/template/defaultfilters.py
@@ -339,7 +339,7 @@ def date(value, arg=None):
def time(value, arg=None):
"Formats a time according to the given format"
from django.utils.dateformat import time_format
- if not value:
+ if value in (None, ''):
return ''
if arg is None:
arg = settings.TIME_FORMAT
@@ -437,7 +437,7 @@ def pluralize(value, arg='s'):
is used instead. If the provided argument contains a comma, the text before
the comma is used for the singular case.
"""
- if not ',' in arg:
+ if not ',' in arg:
arg = ',' + arg
bits = arg.split(',')
if len(bits) > 2: