Ticket #10022: date_based_one_digit_month_confusion.patch
File date_based_one_digit_month_confusion.patch, 1.1 KB (added by , 16 years ago) |
---|
-
django/views/generic/date_based.py
237 237 """ 238 238 if extra_context is None: extra_context = {} 239 239 try: 240 date = datetime.date(*time.strptime(year+month+day, '%Y'+month_format+day_format)[:3]) 240 date = datetime.date(time.strptime(year, '%Y')[0], 241 time.strptime(month, month_format)[1], 242 time.strptime(day, month_format)[2]) 241 243 except ValueError: 242 244 raise Http404 243 245 … … 307 309 """ 308 310 if extra_context is None: extra_context = {} 309 311 try: 310 date = datetime.date(*time.strptime(year+month+day, '%Y'+month_format+day_format)[:3]) 312 date = datetime.date(time.strptime(year, '%Y')[0], 313 time.strptime(month, month_format)[1], 314 time.strptime(day, month_format)[2]) 311 315 except ValueError: 312 316 raise Http404 313 317