Add Clockify import, 4matting
This commit is contained in:
@ -50,15 +50,13 @@ def sync_projects(api, db):
|
||||
return len(projects)
|
||||
|
||||
|
||||
def export_fact(api, fact, project_id):
|
||||
def export_fact(api, project_id, start, end, description=None):
|
||||
"""Export a Hamster fact to Clockify as a time entry"""
|
||||
start = fact.start_time.isoformat()
|
||||
end = fact.end_time.isoformat() if fact.end_time else datetime.now().isoformat()
|
||||
|
||||
time_entry = api.create_time_entry(
|
||||
time_entry = api.time_entries.create(
|
||||
project_id=project_id,
|
||||
start=start,
|
||||
end=end,
|
||||
description=fact.description
|
||||
description=description,
|
||||
billable=True
|
||||
)
|
||||
return time_entry.id
|
||||
return time_entry['id']
|
||||
|
||||
Reference in New Issue
Block a user