Repository navigation
Accept whitespace around friendly dates again - #83
Merged
Merged
Conversation
Making the friendly date parsing strict (848ee02) also made it reject whitespace before or after the date, such as from a pasted date, which 5.2.0 accepted. ParamConverter now strips it before parsing. Other input it made strict, such as day 32 or text after the date, is still rejected, and a blank value still is an error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
slominskir
approved these changes
Oct 6, 2026
Merged
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.
What changed
ParamConverter:convertFriendlyDateandconvertFriendlyDateTimestrip whitespace around the value before parsing. 5.2.0 accepted it (10-Mar-2026,10-Mar-2026 07:30), but the strict parsing added in 848ee02, not yet released, rejected it with "format error", as from a date pasted with a trailing space.ParamConverterTest.convertFriendlyDatesIgnoreSurroundingWhitespace: leading, trailing, tab, and newline whitespace are accepted; a blank value is still an error, as in 5.2.0.The rest of the strict parsing is unchanged: day 32, February 29 of a common year, and text after the date are still rejected.
Compatibility
This restores 5.2.0's behavior for these inputs, so apps need no step. One other input 5.2.0 accepted is still rejected, and the release notes should mention it: a time in the spring-forward gap, such as
08-Mar-2026 02:30, which 5.2.0 moved to 03:30.Checks
ParamConverterTest's 14 tests pass../gradlew buildpassed../gradlew integrationTestran 107 tests, none failed or skipped. The demo's log has no errors.🤖 Generated with Claude Code