fix: Use floats when displaying card intervals#4788
Open
Luc-Mcgrady wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Linked issue (required)
fixes #4787
Summary / motivation (required)
While it is impossible during normal use to get an interval greater than 10 years due to the max_interval. By using set date you can get a larger interval which is then displayed incorrectly. By using a float to store the second values instead of a u32, we can display higher values (although the day interval is still constrained by u32).
Steps to reproduce (required, use N/A if not applicable)
How to test (required)
Follow the steps to reproduce. The number will display as the actual interval in all instances.
Checklist (minimum)
./ninja checkor an equivalent relevant check locally.Details
Before / after behavior (optional)
Risk / compatibility / migration (optional)
Since the value is at max MAX_u32 * 86_400 maybe we should use a u64 instead? largely a moot point as accuracy doesn't matter for the time display functions.
UI evidence (required for visual changes; otherwise N/A)
Scope