Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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.