﻿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
11197	django.utils.dateformat for 'W' is not correct	jumo@…	nobody	"I have a simple problem with the datebased view archive_week. 

In the generic view is something like:

{{{
#!python

In [23]: date = datetime.date(*time.strptime('2009-0-22', '%Y-%w-%U')[:3])

In [24]: date
Out[24]: datetime.date(2009, 5, 31)


}}}

BUT the template-tag ""date"" does the following (and here's the bug):

{{{
#!python
In [19]: now = datetime.datetime.now()

In [20]: now
Out[20]: datetime.datetime(2009, 5, 25, 12, 2, 46, 964892)

In [21]: df = DateFormat(now)

In [22]: df.format(""%W"")
Out[22]: u'%22'

}}}

so my python installation tells me the first day of the 21st week of 2009 was yesterday, but my django installation tells me we have one day later already the 22nd week wich is starting at 31st.

this is a real problem if you write something like this in your templates:

<a href=""{% url aggregator_archive_week year=entry.timestamp_created|date:""Y"", week=entry.timestamp_created|date:""W"", slug=stream.slug %}"">"		closed	Template system	1.0		invalid	dateformat		Unreviewed	0	0	0	0	0	0
