1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #14752 -- Corrected date parsing in WeekArchiveView when using %W as a week format. Thanks to msundstr for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14684 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2010-11-23 01:46:48 +00:00
parent 3498849532
commit 2efb4757af
4 changed files with 20 additions and 4 deletions

View File

@@ -348,9 +348,14 @@ class BaseWeekArchiveView(YearMixin, WeekMixin, BaseDateListView):
week = self.get_week()
date_field = self.get_date_field()
week_format = self.get_week_format()
week_start = {
'%W': '1',
'%U': '0',
}[week_format]
date = _date_from_string(year, self.get_year_format(),
'0', '%w',
week, self.get_week_format())
week_start, '%w',
week, week_format)
# Construct a date-range lookup.
first_day = date