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

EditCounter: local timezone option fix, accommodating fractional timezones #484

Merged
merged 3 commits into from
Sep 2, 2024

Conversation

IndigoManedWolf
Copy link
Contributor

Bubbles now move between rows (days) and change color when changing timezone, instead of looping in the same day. Fractional timezones (e.g. India Standard Time, UTC+5:30) no longer break graph (particularly when turning local timezone option on and off repeatedly).
Bug: T362818

Copy link
Member

@MusikAnimal MusikAnimal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work!

Maybe I'm missing something, but is showing a column for 24:00 an intentional change? That's the only issue I'm seeing.

@IndigoManedWolf
Copy link
Contributor Author

IndigoManedWolf commented Aug 22, 2024

Amazing work!

Maybe I'm missing something, but is showing a column for 24:00 an intentional change? That's the only issue I'm seeing.

Intentional from when I was looking at what happens with fractional timezones, but I had forgotten by the time I made the PR. The motivation is this behavior:

If you set your timezone to a fractional timezone (such as UTC+5:30, where around 1.4 billion people live), bubbles move off of the edge of the chart
image

Actually, if there is a better approach you have in mind I can implement it.

Copy link
Member

@MusikAnimal MusikAnimal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for taking so long to get back to this!

if there is a better approach you have in mind I can implement it

I thought there was a way to add padding to the chart, but I wasn't able to figure it out. We're using a rather old version of Chart.js that I don't think allows for this.

We can however at least hide the "24:00" label. That's really what was bothering me, as that is not a valid time. On line 356 of editcounter.js we could have:

if (value % 2 === 0 && value < 24) {

or something to that effect.

@MusikAnimal
Copy link
Member

The aforementioned isn't a big deal. I'm just going to merge :)

Thank you for taking the time to both identify this bug and fix it!

@MusikAnimal MusikAnimal merged commit 4b8eb28 into x-tools:main Sep 2, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants