Ticket #14752: dates.diff

File dates.diff, 731 bytes (added by Mark Sundstrom, 14 years ago)
  • django/views/generic/dates.py

     
    348348        week = self.get_week()
    349349
    350350        date_field = self.get_date_field()
     351        allowable_week_formats = {'%U':'0', '%W':'1' } # week start on Sunday, Monday
     352        day_of_week = allowable_week_formats[self.get_week_format()]
    351353        date = _date_from_string(year, self.get_year_format(),
    352                                  '0', '%w',
     354                                 day_of_week, '%w',
    353355                                 week, self.get_week_format())
    354356
    355357        # Construct a date-range lookup.
Back to Top