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

rounding bug #716

Merged
Merged

Conversation

PatrickCleary
Copy link
Member

Motivation

There was a rounding bug with the widgets compared to the tooltips. Caused by widgets receiving values in seconds, and tooltips receiving values in minutes, then converting to seconds.

Screenshot 2023-07-06 at 9 46 37 AM

This converts them back to seconds before creating the tooltip, so it will match the widgets. I think the core issue is that we want to round up seconds, and dayjs.duration() does not do that. So we need to round the seconds before creating a duration.

Since the tooltips are just values in seconds divided by 60, we can just multiply by 60.

The more complicated, but more accurate solution would probably be to convert all the charts to take seconds as the values. But this is good enough IMO.

@PatrickCleary PatrickCleary added the bug Something isn't working label Jul 6, 2023
@PatrickCleary PatrickCleary self-assigned this Jul 6, 2023
@github-actions github-actions bot added the frontend Change to frontend code label Jul 6, 2023
Copy link
Member

@devinmatte devinmatte left a comment

Choose a reason for hiding this comment

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

Yeah this seems good to me

@devinmatte devinmatte marked this pull request as ready for review July 6, 2023 15:47
@PatrickCleary PatrickCleary merged commit ca38984 into v4/consistent-time-labels Jul 6, 2023
@PatrickCleary PatrickCleary deleted the v4/consistent-time-labels-2 branch July 6, 2023 15:50
devinmatte added a commit that referenced this pull request Jul 6, 2023
* Updating time labels to be consistent across the app

* Handle less than 1 minute

* Remove padding

* Fix lining wrapping with space

* rounding bug (#716)

* rounding bug

* whoops

---------

Co-authored-by: Patrick Cleary <[email protected]>
@devinmatte devinmatte added the v4 label Jul 15, 2023
@devinmatte devinmatte added this to the Dashboard V4 milestone Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend Change to frontend code
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants