AuHau / toggl-cli

A simple command-line interface for toggl.com

Home Page:https://toggl.uhlir.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

api.TimeEntry.objects.all() returns a limited range of TimeEntries

ErikBjare opened this issue · comments

Hi there, nice project!

I'm bumping into what I assume is a 'events no older than 1 month' limit or similar when calling api.TimeEntry.objects.all(), wondering if there's a way around that?

Hey there,

yeah the underlying API call is quite limited about this. I am planning to implement a call for Report's API through which you should be able to retrieve all Entries. I will have a look on it today/tomorrow.

So I have written support for the Report's API call (e0bd703).

Try it out and let me know if that solves your problem.

api.TimeEntry.objects.all_from_reports()

Works great! Thanks a bunch! ❤️

Oh and btw, since you're obviously interested in time tracking, check out my project ActivityWatch if you're interested!

@AuHau Hey just a heads up: It seems I get milliseconds in the duration field of the TimeEntry from the all_from_reports() API, not seconds (as I expected, which I think was the behavior in all())

Oh ups! Sorry!

I haven't see the difference in the documentation. It is weird that they have such inconsistency in the APIs.

I pushed a fix. Will release another beta release later in the day with this.