Skip to content

Commit

Permalink
Merge pull request #43 from HazardDede/master
Browse files Browse the repository at this point in the history
Fixes wrong default value behaviour in `Event.time_left`
  • Loading branch information
Thomas Irgang authored Jan 29, 2019
2 parents 83107b6 + 5c8da47 commit 000a981
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion icalevents/icalparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ def __init__(self):
self.recurring = False
self.location = None

def time_left(self, time=now()):
def time_left(self, time=None):
"""
timedelta form now to event.
:return: timedelta from now
"""
time = time or now()
return self.start - time

def __lt__(self, other):
Expand Down

0 comments on commit 000a981

Please sign in to comment.