Skip to content

fix: Use floats when displaying card intervals#4788

Open
Luc-Mcgrady wants to merge 3 commits into
ankitects:mainfrom
Luc-Mcgrady:interval-display
Open

fix: Use floats when displaying card intervals#4788
Luc-Mcgrady wants to merge 3 commits into
ankitects:mainfrom
Luc-Mcgrady:interval-display

Conversation

@Luc-Mcgrady
Copy link
Copy Markdown
Contributor

@Luc-Mcgrady Luc-Mcgrady commented May 7, 2026

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)

  1. use set interval with a massive number
  2. check the

How to test (required)

Follow the steps to reproduce. The number will display as the actual interval in all instances.

Checklist (minimum)

  • I ran ./ninja check or an equivalent relevant check locally.
  • I added or updated tests when the change is non-trivial or behavior changed.

Details

Before / after behavior (optional)

image image

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

  • This PR is focused on one change (no unrelated edits).

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.

Interval displayed wrong in browser after using set due date

1 participant