fix: restore native Date fallback when strictParsing is false#6172
Merged
martijnrusschen merged 1 commit intomainfrom Dec 18, 2025
Merged
fix: restore native Date fallback when strictParsing is false#6172martijnrusschen merged 1 commit intomainfrom
martijnrusschen merged 1 commit intomainfrom
Conversation
When strictParsing is false (the default), restore the native Date parsing fallback that was present in v7.x but accidentally removed in v8.0.0. This allows flexible input formats like "12/05/2025" or "2025-12-16 3:31:01 PM" to be parsed even when the dateFormat prop specifies a different format. The fallback only triggers when: 1. strictParsing is false (default) 2. The input is at least 8 characters (to avoid parsing partial inputs) 3. date-fns parsing with the specified format(s) failed This fixes the regression where v8.x required exact format matches even with strictParsing disabled. Fixes #6164 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6172 +/- ##
==========================================
+ Coverage 99.26% 99.31% +0.05%
==========================================
Files 30 30
Lines 3801 3805 +4
Branches 1652 1654 +2
==========================================
+ Hits 3773 3779 +6
+ Misses 27 25 -2
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
strictParsingis false (the default), flexible input formats like12/05/2025or2025-12-16 3:31:01 PMare now parsed even when thedateFormatprop specifies a different formatProblem
In v8.0.0, the
parseDatefunction was refactored and the nativenew Date(value)fallback was removed. This caused a regression where users could no longer type dates in flexible formats - only exact matches to thedateFormatprop were accepted.Before v8 (working):
v8.0.0+ (broken):
Solution
Add back the native Date fallback when
strictParsingis false. The fallback only triggers when:strictParsingis false (default)Test plan
Fixes #6164
🤖 Generated with Claude Code