-
Notifications
You must be signed in to change notification settings - Fork 6k
Correct .NET Framework bug documentation for MMM format specifier genitive behavior #48061
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
base: main
Are you sure you want to change the base?
Conversation
… format specifiers Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com>
DateTimeFormatInfo.AbbreviatedMonthGenitiveNames
usage is wrong for .NET Framework
The case of |
@adegeo I left the comment #48061 (comment). |
Note that I didn't test .NET 7 or older versions of .NET Core. So this could also have been a change in a .NET version earlier than 8. |
This is fixed in .NET 5.0 But I think the doc is mentioning the currently supported version of the .NET. |
@tarekgh OK, so really it sounds like all of the "d, dd -- genitive" info for "MMM" should be removed, right? |
Here’s what I’m trying to say:
So, we should keep the documentation for genitive month names with both |
Yes, please. That's the reason I created the issue. If it will never be changed in .NET Framework than it doesn't matter if the difference is because of a bug or a feature difference. |
@copilot we've received clarification on how this actually works. There is no difference with |
- Remove version notes from MMMM as it works correctly in both .NET Framework and .NET - Update MMM to clarify it's a .NET Framework bug that was fixed in .NET Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com>
Updated the documentation as requested:
The documentation now accurately reflects that MMMM works consistently across versions, while MMM has a known bug in .NET Framework that was resolved in .NET. Commit: a9610a7 |
@@ -70,8 +70,8 @@ In parsing operations, custom date and time format strings can be used with the | |||
| "mm" | The minute, from 00 to 59.<br /><br /> More information: [The "mm" Custom Format Specifier](#mmSpecifier). | 2009-06-15T01:09:30 -> 09<br /><br /> 2009-06-15T01:45:30 -> 45 | | |||
| "M" | The month, from 1 to 12.<br /><br /> More information: [The "M" Custom Format Specifier](#M_Specifier). | 2009-06-15T13:45:30 -> 6 | | |||
| "MM" | The month, from 01 to 12.<br /><br /> More information: [The "MM" Custom Format Specifier](#MM_Specifier). | 2009-06-15T13:45:30 -> 06 | | |||
| "MMM" | The abbreviated name of the month.<br /><br /> More information: [The "MMM" Custom Format Specifier](#MMM_Specifier). | 2009-06-15T13:45:30 -> Jun (en-US)<br /><br /> 2009-06-15T13:45:30 -> juin (fr-FR)<br /><br /> 2009-06-15T13:45:30 -> Jun (zu-ZA) | | |||
| "MMMM" | The full name of the month.<br /><br /> More information: [The "MMMM" Custom Format Specifier](#MMMM_Specifier). | 2009-06-15T13:45:30 -> June (en-US)<br /><br /> 2009-06-15T13:45:30 -> juni (da-DK)<br /><br /> 2009-06-15T13:45:30 -> uJuni (zu-ZA) | | |||
| "MMM" | The abbreviated name of the month. When used with "d" or "dd" specifiers, uses genitive names (note: this is a known bug in .NET Framework that was fixed in .NET).<br /><br /> More information: [The "MMM" Custom Format Specifier](#MMM_Specifier). | 2009-06-15T13:45:30 -> Jun (en-US)<br /><br /> 2009-06-15T13:45:30 -> juin (fr-FR)<br /><br /> 2009-06-15T13:45:30 -> Jun (zu-ZA) | |
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.
docs/standard/base-types/custom-date-and-time-format-strings.md
Outdated
Show resolved
Hide resolved
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.
Added a small suggestion, LGTM otherwise.
Thanks!
The documentation for custom date and time format strings incorrectly presented the genitive names behavior as a version-specific feature introduced in .NET 8. Based on technical review, the actual behavior is:
Changes Made
Updated the documentation to accurately reflect this behavior:
Example of the Issue
In .NET Framework, a format string like
"d MMM"
will always useAbbreviatedMonthNames
(the bug), whereas in .NET it correctly usesAbbreviatedMonthGenitiveNames
when the "d" specifier is present. TheMMMM
specifier works correctly in both versions.Fixes #48015.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Internal previews