Skip to content

fix: cap year at 4 digits and prevent crash on invalid datetime input#5035

Merged
aseckin merged 4 commits into
mainfrom
claude/issue-3640-when-creating-a-question-there
Jul 17, 2026
Merged

fix: cap year at 4 digits and prevent crash on invalid datetime input#5035
aseckin merged 4 commits into
mainfrom
claude/issue-3640-when-creating-a-question-there

Conversation

@aseckin

@aseckin aseckin commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Fixes #3640

Summary

  • 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.

Test plan

  • Open question creation form, try to type a 5+ digit year — browser should cap at 4 digits.
  • Confirm the page no longer crashes when an out-of-range date is briefly entered.

Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved datetime input handling by ensuring the displayed default value uses the correctly formatted local datetime.
    • Prevented unnecessary reformatting that could cause inconsistencies in date and time displays.

- 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>
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 064c99fa-fcf6-4094-ba9d-295cd9340efe

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/issue-3640-when-creating-a-question-there

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Cleanup: Preview Environment Removed

The preview environment for this PR has been destroyed.

Resource Status
🌐 Preview App Deleted
🗄️ PostgreSQL Branch Deleted
⚡ Redis Database Deleted
🔧 GitHub Deployments Removed
📦 Docker Image Retained (auto-cleanup via GHCR policies)

Cleanup triggered by PR close at 2026-07-17T13:32:27Z

@aseckin
aseckin requested a review from ncarazon July 17, 2026 09:04
@aseckin
aseckin marked this pull request as ready for review July 17, 2026 09:04
@aseckin
aseckin merged commit 883b589 into main Jul 17, 2026
14 of 15 checks passed
@aseckin
aseckin deleted the claude/issue-3640-when-creating-a-question-there branch July 17, 2026 13:32
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.

When creating a question, there are six values for the years in closing and resolving time

2 participants