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

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

Closed
pjyi2147 opened this issue Oct 27, 2024 · 3 comments
Assignees
Labels
bug Something isn't working effort:1

Comments

@pjyi2147
Copy link

pjyi2147 commented Oct 27, 2024

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
@muety
Copy link
Owner

muety commented Oct 30, 2024

Thanks for bringing this up. Will fix it asap!

@muety muety self-assigned this Oct 30, 2024
@muety muety added bug Something isn't working effort:1 labels Oct 30, 2024
@muety muety closed this as completed in c7b0747 Nov 3, 2024
@pjyi2147
Copy link
Author

pjyi2147 commented Nov 4, 2024

Hi, thanks for fixing the issue! Just one more thing, could you update your docker image so that I can have the fixed version? Thanks so much!

@muety
Copy link
Owner

muety commented Nov 4, 2024

New release (incl. updated Docker images) will be pushed soon. Wanna include a bunch of more changes in addition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working effort:1
Projects
None yet
Development

No branches or pull requests

2 participants