Skip to content

fix: round-trip */N notation for large step intervals#88

Merged
xrutayisire merged 1 commit intomasterfrom
xru/clear-button-period-fix
Apr 3, 2026
Merged

fix: round-trip */N notation for large step intervals#88
xrutayisire merged 1 commit intomasterfrom
xru/clear-button-period-fix

Conversation

@xrutayisire
Copy link
Copy Markdown
Owner

Summary

  • Fix partToString to correctly output */N notation when a 2-element array forms a full interval (e.g., months [1, 7]*/6 instead of 1,7)
  • The existing getStep function requires 3+ values, so large steps like */6 on months (which produce only 2 values) were silently downgraded to comma notation
  • Add targeted check that only fires for full intervals starting at unit min — zero collateral format changes on non-full intervals or consecutive pairs

Closes #69

Test plan

  • 3 new test cases: */6 months, */30 minutes, */12 hours — all verify round-trip and dropdown display
  • All 86 tests pass (83 existing + 3 new)
  • Exhaustive enumeration of all possible 2-element arrays across all 5 unit types: 66 desired */N fixes, 0 collateral changes
  • Visual regression: 34 Storybook stories screenshotted against production, 0 differences
  • Build passes

🤖 Generated with Claude Code

The `getStep` function requires 3+ values to detect step intervals, but
large steps like `*/6` on months produce only 2 values (`[1, 7]`). This
caused `partToString` to output `1,7` instead of `*/6`.

Add a targeted check in `partToString` for 2-element arrays that form a
full interval (starting from unit min, covering the full range). This
restores `*/N` notation without changing output for non-full intervals
or consecutive pairs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@xrutayisire xrutayisire merged commit d069ff0 into master Apr 3, 2026
3 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.

A bug with "evety six month" (*/6)

1 participant