fix: cap year at 4 digits and prevent crash on invalid datetime input#5035
Conversation
- Add max="9999-12-31[T23:59]" to datetime-local inputs so years cannot exceed 4 digits. - Drop the redundant `format(localValue, formatStr)` call in the render path — `localValue` is already the formatted string from the effect, and re-formatting a raw user string with an out-of-range year threw `RangeError: Invalid time value` mid-render, which the global error boundary caught as a page crash. Fixes #3640 Co-authored-by: aseckin <3686968+aseckin@users.noreply.github.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Cleanup: Preview Environment RemovedThe preview environment for this PR has been destroyed.
Cleanup triggered by PR close at 2026-07-17T13:32:27Z |
Fixes #3640
Summary
max="9999-12-31[T23:59]"to datetime-local inputs so years cannot exceed 4 digits.format(localValue, formatStr)call in the render path —localValueis already the formatted string from the effect, and re-formatting a raw user string with an out-of-range year threwRangeError: Invalid time valuemid-render, which the global error boundary caught as a page crash.Test plan
Generated with Claude Code
Summary by CodeRabbit