diff options
-rwxr-xr-x | worktime.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/worktime.py b/worktime.py index 639d09c..1cc648a 100755 --- a/worktime.py +++ b/worktime.py | |||
@@ -51,7 +51,7 @@ class TogglAPI(object): | |||
51 | def get_billable_hours(self, start_date, end_date=datetime.now(timezone.utc), rounding=False): | 51 | def get_billable_hours(self, start_date, end_date=datetime.now(timezone.utc), rounding=False): |
52 | url = self._make_url(api = TogglAPISection.REPORTS, section = ['summary'], params={'since': start_date.astimezone(timezone.utc).isoformat(), 'until': end_date.astimezone(timezone.utc).isoformat(), 'rounding': rounding}) | 52 | url = self._make_url(api = TogglAPISection.REPORTS, section = ['summary'], params={'since': start_date.astimezone(timezone.utc).isoformat(), 'until': end_date.astimezone(timezone.utc).isoformat(), 'rounding': rounding}) |
53 | r = self._query(url = url, method='GET') | 53 | r = self._query(url = url, method='GET') |
54 | return timedelta(milliseconds=r.json()['total_billable']) | 54 | return timedelta(milliseconds=r.json()['total_billable']) if r.json()['total_billable'] else timedelta(milliseconds=0) |
55 | 55 | ||
56 | def get_running_clock(self, now=datetime.now(timezone.utc)): | 56 | def get_running_clock(self, now=datetime.now(timezone.utc)): |
57 | url = self._make_url(api = TogglAPISection.TOGGL, section = ['time_entries', 'current']) | 57 | url = self._make_url(api = TogglAPISection.TOGGL, section = ['time_entries', 'current']) |