Skip to content

Update C# examples for ja-JP and en-US DateTimeFormatInfo #10141

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

Merged
merged 4 commits into from
Jul 24, 2024

Conversation

matouskozak
Copy link
Member

Summary

In dotnet/runtime#105097, we discovered that the example provided for .NET DateTimePattern are out-of-date. In this PR, we update the examples of FullDateTimePattern, LongDatePattern, MonthDayPattern for en-US and ja-JP cultures.


cc: @tarekgh @vitek-karas

@matouskozak matouskozak requested a review from a team as a code owner July 23, 2024 14:13
@ghost ghost added the area-System.DateTime label Jul 23, 2024
@matouskozak matouskozak changed the title Update C# ja-JP and en-US DateTimeFormatInfo Update C# examples for ja-JP and en-US DateTimeFormatInfo Jul 23, 2024
Copy link

Learn Build status updates of commit d7166c1:

✅ Validation status: passed

File Status Preview URL Details
snippets/csharp/System.Globalization/DateTimeFormatInfo/FullDateTimePattern/dtfi_fulldatetimepattern.cs ✅Succeeded View
snippets/csharp/System.Globalization/DateTimeFormatInfo/LongDatePattern/dtfi_longdatepattern.cs ✅Succeeded View
snippets/csharp/System.Globalization/DateTimeFormatInfo/MonthDayPattern/dtfi_monthdaypattern.cs ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

@matouskozak
Copy link
Member Author

I see Error: ERROR: Project missing. A project (and optionally a solution file) must be in this directory or one of the parent directories to validate and build this code. failure in the Snippets 5000 job. Am I missing something?

@tarekgh
Copy link
Member

tarekgh commented Jul 23, 2024

@gewarren do you know why the CI is failing while updating only existing sample source?

@gewarren
Copy link
Contributor

@gewarren do you know why the CI is failing while updating only existing sample source?

Yes, we are trying to get project files added for every snippet, so if a project file doesn't exist for any snippet that's touched, it errors.

@tarekgh
Copy link
Member

tarekgh commented Jul 24, 2024

we are trying to get project files added for every snippet, so if a project file doesn't exist for any snippet that's touched, it errors.

Should we ignore the error? or we must add the project file with the change?

@gewarren
Copy link
Contributor

we are trying to get project files added for every snippet, so if a project file doesn't exist for any snippet that's touched, it errors.

Should we ignore the error? or we must add the project file with the change?

If Matous can add one, that would be great. Something like this, but might as well target .NET 8: https://github.com/dotnet/dotnet-api-docs/blob/main/snippets/csharp/System.Globalization/DateTimeFormatInfo/FullDateTimePattern/Project.csproj

@matouskozak
Copy link
Member Author

matouskozak commented Jul 24, 2024

we are trying to get project files added for every snippet, so if a project file doesn't exist for any snippet that's touched, it errors.

Should we ignore the error? or we must add the project file with the change?

If Matous can add one, that would be great. Something like this, but might as well target .NET 8: https://github.com/dotnet/dotnet-api-docs/blob/main/snippets/csharp/System.Globalization/DateTimeFormatInfo/FullDateTimePattern/Project.csproj

I added the Project.csproj, however now it complains that D:\a\dotnet-api-docs\dotnet-api-docs\snippets\csharp\System.Globalization\DateTimeFormatInfo\LongDatePattern\longdatepattern2.cs(8,23): error CS0111: Type 'Example' already defines a member called 'Main' with the same parameter types [D:\a\dotnet-api-docs\dotnet-api-docs\snippets\csharp\System.Globalization\DateTimeFormatInfo\LongDatePattern\Project.csproj] and D:\a\dotnet-api-docs\dotnet-api-docs\snippets\csharp\System.Globalization\DateTimeFormatInfo\LongDatePattern\longdatepattern2.cs(6,14): error CS0101: The namespace '<global namespace>' already contains a definition for 'Example' [D:\a\dotnet-api-docs\dotnet-api-docs\snippets\csharp\System.Globalization\DateTimeFormatInfo\LongDatePattern\Project.csproj].

Should I rename the public class Example in longdatepattern1/2.cs to public class Example1/2 or what is the proper fix here?

@gewarren
Copy link
Contributor

Should I rename the public class Example in longdatepattern1/2.cs to public class Example1/2 ...?

Yes, please. Sorry for the hassle.

@matouskozak
Copy link
Member Author

Should I rename the public class Example in longdatepattern1/2.cs to public class Example1/2 ...?

Yes, please. Sorry for the hassle.

No problem, thank you for the help. Looks to be green now.

@gewarren gewarren enabled auto-merge (squash) July 24, 2024 17:32
@gewarren gewarren merged commit 7384cbe into dotnet:main Jul 24, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants