﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
1385	[PATCH] allow timesince filter to work with datetime.date objects	matt	Adrian Holovaty	"The timesince filter currently throws an AttributeError when applied to a {{{ datetime.date }}} object:

{{{
'defaultfilters' module: API test raised an exception
=====================================================
Code: 'timesince(datetime.date.today() - datetime.timedelta(1))'
Line: 232
Exception:   File ""/Users/mcroydon/django/django_src.trunk/tests/doctest.py"", line 1243, in __run
    compileflags, 1) in test.globs
  File ""<doctest defaultfilters[76]>"", line 1, in ?
    timesince(datetime.date.today() - datetime.timedelta(1))
  File ""/Users/mcroydon/django/django_src.trunk/django/core/template/defaultfilters.py"", line 343, in timesince
    return timesince(value)
  File ""/Users/mcroydon/django/django_src.trunk/django/utils/timesince.py"", line 22, in timesince
    if d.tzinfo:
AttributeError: 'datetime.date' object has no attribute 'tzinfo'
}}}

The patch includes a test to confirm this behavior.  The test passes after applying this patch."	defect	closed	Template system	dev	normal	fixed			Unreviewed	0	0	0	0	0	0
