mirror of
https://github.com/django/django.git
synced 2025-09-20 01:10:35 +00:00
Fixed #4768 -- Converted timesince and dateformat to use explicit floor division (pre-emptive avoidance of Python 3000 compatibility problem), and removed a redundant millisecond check. Thanks, John Shaffer <jshaffer2112@gmail.com>.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5671 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
1345f3c521
commit
34655a3e78
3 changed files with 4 additions and 5 deletions
|
@ -227,7 +227,7 @@ class DateFormat(TimeFormat):
|
|||
week_number = 1
|
||||
else:
|
||||
j = day_of_year + (7 - weekday) + (jan1_weekday - 1)
|
||||
week_number = j / 7
|
||||
week_number = j // 7
|
||||
if jan1_weekday > 4:
|
||||
week_number -= 1
|
||||
return week_number
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue