-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Fix DateTime fraction specifier parsing #120518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix DateTime fraction specifier parsing #120518
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug in DateTime fraction specifier parsing where the ".F" format pattern was not being handled correctly when the decimal point was missing from the input string. The fix removes incorrect nested braces that were preventing proper execution of the optional fraction handling logic.
- Corrects brace placement in DateTimeParse.cs to allow proper execution of optional fraction logic
- Adds comprehensive test coverage for .F, .FF, and .FFF format specifiers
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/libraries/System.Private.CoreLib/src/System/Globalization/DateTimeParse.cs | Fixes incorrect brace placement that was preventing optional fraction specifier logic from executing |
| src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DateTimeTests.cs | Adds test cases to verify .F format specifier parsing works correctly |
src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DateTimeTests.cs
Show resolved
Hide resolved
src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DateTimeTests.cs
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
|
Tagging subscribers to this area: @dotnet/area-system-datetime |
src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DateTimeTests.cs
Show resolved
Hide resolved
…com/tarekgh/runtime into FixDateTimeFractionSpecifierParsing
Fixes #120468