Skip to content

Commit

Permalink
remove date case
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Bernhardsson committed Jun 12, 2018
1 parent 7bd99dc commit d7067a3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions convoys/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@ def get_groups(data, group_min_size, max_groups):

def _sub(a, b):
# Computes a - b for a bunch of different cases
if isinstance(a, datetime.date):
return a - b
elif isinstance(a, datetime.datetime) and a.tzinfo is not None:
if isinstance(a, datetime.datetime) and a.tzinfo is not None:
return a.astimezone(b.tzinfo) - b
else:
# Either naive timestamps or numerical type
return a - b


Expand Down

0 comments on commit d7067a3

Please sign in to comment.