Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jirikuchta committed Jun 21, 2023
1 parent 4eb470f commit e4d5b71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions garminicalexport/activities.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ def ical_dtstart(self) -> datetime:

@property
def ical_dtend(self) -> datetime:
duration = self._data.get("elapsedDuration") \
or self._data.get("duration") or 0
return self.ical_dtstart + timedelta(seconds=duration)
duration = self._data.get(
"elapsedDuration", self._data.get("duration"))
return self.ical_dtstart + timedelta(seconds=round(duration or 0))


class RunningActivity(Activity):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def readme():

setup(
name="garmin-ical-export",
version="1.0.6",
version="1.0.7",
description="Export Garmin Connect activities to iCalendar file",
long_description=readme(),
long_description_content_type="text/markdown",
Expand Down

0 comments on commit e4d5b71

Please sign in to comment.