-
Notifications
You must be signed in to change notification settings - Fork 6k
Add .NET 8+ version notes for genitive names behavior in custom date/time format strings #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. |
The documentation for custom date and time format strings incorrectly stated that the MMM and MMMM format specifiers use genitive names (from
AbbreviatedMonthGenitiveNames
andMonthGenitiveNames
properties) when "d" or "dd" custom format specifiers are present in the format string across all .NET versions.This behavior actually only applies to .NET 8 and later versions, not .NET Framework 4.8 as originally documented.
Changes Made
Updated the documentation to clarify version-specific behavior:
The changes are minimal and surgical - only 4 lines were modified to add the necessary version clarifications without changing any existing functionality descriptions.
Example of the Issue
In .NET Framework 4.8, a format string like
"d MMM"
will always useAbbreviatedMonthNames
, whereas in .NET 8+ it will useAbbreviatedMonthGenitiveNames
when the "d" specifier is present.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