Skip to content

Commit

Permalink
[#2494] Make sure only 'aware' date objects are compared
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Oderbolz committed Jul 9, 2015
1 parent a164ac7 commit dabc0c8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ckan/lib/formatters.py
Expand Up @@ -106,6 +106,7 @@ def months_between(date1, date2):
now = now.replace(tzinfo=datetime_.tzinfo)
else:
now = now.replace(tzinfo=pytz.utc)
datetime_ = datetime_.replace(tzinfo=pytz.utc)
date_diff = now - datetime_
days = date_diff.days
if days < 1 and now > datetime_:
Expand Down

0 comments on commit dabc0c8

Please sign in to comment.