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

[Bug]: activity chart may show incorrect date depending on browser timezone #8393

Open
xmcp opened this issue Feb 8, 2025 · 1 comment
Open
Labels
bug Something isn't working mlops user request

Comments

@xmcp
Copy link

xmcp commented Feb 8, 2025

What happened?

If the browser timezone is a positive value, the date shown in the activity charts will be off by one:

Image

This bug is due to the standardizeDate function:

...
const fullDate = new Date(year, monthIndex, parseInt(day));
return fullDate.toISOString().split('T')[0];

Since new Date constructs the Date object in local timezone and toISOString converts it to GMT+0, it will become the previous day if the browser timezone is >0. We should use Date.UTC instead.

Image

Other calls to toISOString may have the same problem, but I didn't check them individually.

Relevant log output

N/A

Are you a ML Ops Team?

Yes

What LiteLLM version are you on ?

v1.60.2

Twitter / LinkedIn details

No response

@xmcp xmcp added the bug Something isn't working label Feb 8, 2025
@quocnguyendinh-ct
Copy link

I also the same this issue

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

No branches or pull requests

2 participants