Do [8221] in a slightly more clean way.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8222 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
9f6ab8104c
commit
d06b474251
|
@ -129,6 +129,7 @@ class Feed(object):
|
|||
author_email = author_link = None
|
||||
|
||||
pubdate = self.__get_dynamic_attr('item_pubdate', item)
|
||||
if pubdate:
|
||||
now = datetime.now()
|
||||
utcnow = datetime.utcnow()
|
||||
|
||||
|
@ -141,7 +142,6 @@ class Feed(object):
|
|||
tzDifference = (now - utcnow)
|
||||
|
||||
# Round the timezone offset to the nearest half hour.
|
||||
if pubdate:
|
||||
tzOffsetMinutes = sign * ((tzDifference.seconds / 60 + 15) / 30) * 30
|
||||
tzOffset = timedelta(minutes=tzOffsetMinutes)
|
||||
pubdate = pubdate.replace(tzinfo=FixedOffset(tzOffset))
|
||||
|
|
Loading…
Reference in New Issue