From 69970c39023fb4309db1aa08afeddb59d42dcc05 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 1 Apr 2020 08:49:57 +0200 Subject: fix worktime --- worktime.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'worktime.py') diff --git a/worktime.py b/worktime.py index 19e2186..3f577ea 100755 --- a/worktime.py +++ b/worktime.py @@ -46,7 +46,7 @@ class TogglAPI(object): def get_billable_hours(self, start_date, end_date=datetime.now(timezone.utc)): url = self._make_url(api = TogglAPISection.REPORTS, section = ['summary'], params={'since': start_date.astimezone(timezone.utc).isoformat(), 'until': end_date.astimezone(timezone.utc).isoformat()}) r = self._query(url = url, method='GET') - return timedelta(milliseconds=r.json()['total_billable']) + return timedelta(milliseconds=r.json()['total_billable']) if r.json()['total_billable'] else timedelta(milliseconds=0) def get_running_clock(self, now=datetime.now(timezone.utc)): url = self._make_url(api = TogglAPISection.TOGGL, section = ['time_entries', 'current']) -- cgit v1.2.3