Skip to content

Inconsistent time format from api/compat/wakatime/v1/users/{users}/stats/all_time #698

Closed
@pjyi2147

Description

Describe the bug
A clear and concise description of what the bug is. Please briefly describe how to reproduce the bug as well as expected vs. actual behavior. Optionally include screenshots and server logs, if helpful.

I am using waka-readme with github actions to update my readme daily.

It keep giving me an error with inconsistent time format previously discussed in athul/waka-readme#112

The formats with issue are:

2024-10-27T14:02:30.88807562-04:00  # RFC3339Nano
2024-09-30T02:13:54.428Z # RFC3339? ISO8601 with miliseconds?

you can take a look previous runs of my actions here:
https://github.com/pjyi2147/pjyi2147/actions/runs/11542659933/job/32126127952
https://github.com/pjyi2147/pjyi2147/actions/runs/11428021776/job/31792859789

I am guessing the issue is coming from https://github.com/muety/wakapi/blob/master/models/compat/wakatime/v1/stats.go having time struct instead of string as in https://github.com/muety/wakapi/blob/master/models/compat/wakatime/v1/all_time.go.

It seems like Go compiler selects whatever time format it pleases.

Workaround suggestion is to set Start and End struct parameter to string with specific time format - it will be great if we can select the time conversion format for api output through environment variable.

Thanks for great work! I appreciate your work a lot.

System information
Please provide information on:

  • Wakapi version: latest
  • Operating system
    • If Linux: which distro? oracle linux
    • If Docker: which image and tag? ghcr.io/muety/wakapi:latest
  • Database (SQLite, MySQL, ... ?) postgres

Metadata

Assignees

Labels

bugSomething isn't workingeffort:1

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions