Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arbitrary reports span #55

Closed
JamesNZL opened this issue Jun 11, 2023 · 15 comments
Closed

Arbitrary reports span #55

JamesNZL opened this issue Jun 11, 2023 · 15 comments
Assignees
Labels
feature New feature or request

Comments

@JamesNZL
Copy link
Owner

Allow tgl reports between two arbitrary start/end dates.

@JamesNZL JamesNZL added the feature New feature or request label Jun 11, 2023
@JamesNZL JamesNZL self-assigned this Jun 11, 2023
@JamesNZL
Copy link
Owner Author

Use = syntax, ie tgl reports day=21/05/2023

@JamesNZL
Copy link
Owner Author

JamesNZL commented Jul 2, 2023

Hm. Really not sure if this is worth implementing—trying to enforce a parse-able input format would probably make it sufficiently unfriendly to use that you might as well use Toggl directly.

Will leave open for now, though.

@JamesNZL JamesNZL added the question Further information is requested label Jul 2, 2023
@JamesNZL
Copy link
Owner Author

JamesNZL commented Jul 4, 2023

Would be useful to quickly see what one did on a specific day, without needing to figure out how many days ago it was.

So not exactly a span, but a laser pointer.

But maybe might as well implement full span support at that point?

@JamesNZL JamesNZL removed the question Further information is requested label Jul 4, 2023
@JamesNZL
Copy link
Owner Author

JamesNZL commented Jul 5, 2023

So, I could either:

  1. Use = to set a specific reference date of the span, ie

    tgl reports day=21/05/2023
    

    will get the daily report for 21 May.

    tgl reports week=21/05/2023
    

    will get the weekly report for the week of 21 May.

    • This makes it easy to quickly jump to a specific span report for a given date.
    • This stays within the present restrictions of days/weeks/months/years, and still does not allow you to break out of it (ie get a span of 3 days, for example)
      • Toggl also does this though, I'm pretty sure you can't actually get a completely arbitrary span.
  2. Create a new result to define a custom span.

    tgl reports 21/05/2023[some non-whitespace separator]24/05/2023
    

    will get the report for the specified span.

    • Probably harder to use?
    • What separator?
      • Can't use -, as this is commonly used to separate dates.
      • Maybe >? ie [date one]>(to)[date two]?

@JamesNZL
Copy link
Owner Author

JamesNZL commented Jul 5, 2023

Ideally will need to support 21/05/2023, 21.05.2023, 21-05-2023, 05-21-2023 (with user's default culture), etc

@JamesNZL
Copy link
Owner Author

JamesNZL commented Jul 5, 2023

Probably prefer 2.

  • New Usage Tip to type a custom date for an arbitrary report span.
  • Move Regex to ReportsSpanCommandArgument so each arg can define its own regex
  • Rename offset to capture as it will no longer necessarily be an offset
  • Apparently TimeSpanParser can parse the same strings as DateTime.Parse? Test if this uses local culture

edit: I did none of this

@JamesNZL
Copy link
Owner Author

JamesNZL commented Jul 6, 2023

Apparently TimeSpanParser can parse the same strings as DateTime.Parse? Test if this uses local culture

Oh, lol. Oops.

Also accepts whatever .NET's TimeSpan.Parse() will accept (US and common formats only for now)

TimeSpan.Parse.

@JamesNZL
Copy link
Owner Author

JamesNZL commented Jul 6, 2023

Warning Need to ensure the span does not exceed 12 mo.

@JamesNZL
Copy link
Owner Author

JamesNZL commented Jul 6, 2023

Hm... Ideally it would support something like

tgl reports "15:30 23/05"

ie, let the user self-specify the time, not just the date.

Warning Need to check the logic for inserting the currently running time entry.

Problem is that the above query is broken on the white space... TransformedQuery time?

@JamesNZL
Copy link
Owner Author

JamesNZL commented Jul 6, 2023

Alternatively... I decouple it from ArgumentIndices... treat it as a TransformedQuery#After ArgumentIndices.Command.

This would make it a proper pain after span/grouping selection, though?

@JamesNZL
Copy link
Owner Author

JamesNZL commented Jul 6, 2023

Or... a RTFM moment and tell the user to use

tgl reports 15:30_23/05`

and replace the _ with a whitespace when parsing?

@JamesNZL
Copy link
Owner Author

JamesNZL commented Jul 6, 2023

Or... a RTFM moment and tell the user to use

tgl reports 15:30_23/05`

and replace the _ with a whitespace when parsing?

Will do this.

@JamesNZL
Copy link
Owner Author

JamesNZL commented Jul 6, 2023

Hm... Ideally it would support something like

tgl reports "15:30 23/05"

ie, let the user self-specify the time, not just the date.

Warning Need to check the logic for inserting the currently running time entry.

Problem is that the above query is broken on the white space... TransformedQuery time?

Oh, the API doesn't really support times.

https://developers.track.toggl.com/docs/reports/summary_reports#post-search-time-entries

Could still do it for the start time, but no end time.

@JamesNZL
Copy link
Owner Author

JamesNZL commented Jul 7, 2023

23/04/2021> will set the end date to DateTimeOffset.Now, rather than failing to parse.

@JamesNZL
Copy link
Owner Author

JamesNZL commented Jul 7, 2023

Hm... Ideally it would support something like

tgl reports "15:30 23/05"

ie, let the user self-specify the time, not just the date.

Warning Need to check the logic for inserting the currently running time entry.

Problem is that the above query is broken on the white space... TransformedQuery time?

Oh, the API doesn't really support times.

https://developers.track.toggl.com/docs/reports/summary_reports#post-search-time-entries

Could still do it for the start time, but no end time.

Hm, nevermind.

None of the formats for start-time I have tried have changed the API response at all, and startTime just 404's.
image

Closing as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant