﻿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
14752	WeekArchiveView gives incorrect results when using weeks beginning with Monday	Mark Sundstrom	nobody	"WeekArchiveView defaults to weeks defined as beginning on Sunday (the strptime '%U' format) and this works correctly. Using weeks defined as beginning on Monday ('%W'), gives incorrect results. This is because BaseWeekArchiveView.get_dated_items calls the helper function, _date_from_string, with the wrong format. 

For example, for the 10th week in 2009, beginning on Sunday, it correctly constructs the following:
   {{{ time.strptime('2009__0__10', '%Y__%w__%U') }}}
However, for the 10th week in 2009, beginning on Monday, it incorrectly constructs:
   {{{ time.strptime('2009__0__10', '%Y__%w__%W') }}}
This can be fixed by using:
  {{{ time.strptime('2009__1__10', '%Y__%w__%W') }}}
The '1' refers to the day of the week being Monday (Sunday = 0).

I've attached a patch, tests.diff, which demonstrates the problem, and another patch, dates.diff, with the correction. 
"		closed	Generic views	dev		fixed			Accepted	1	0	0	1	0	0
