-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Update minimum supported date for .NET 11 #12207
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
snippets/csharp/System.Globalization/JapaneseCalendar/MaxSupportedDateTime/Project.csproj
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <OutputType>Library</OutputType> | ||
| <TargetFramework>net6.0</TargetFramework> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>net10.0</TargetFramework> | ||
| </PropertyGroup> | ||
|
|
||
| </Project> | ||
63 changes: 36 additions & 27 deletions
63
...arp/System.Globalization/JapaneseCalendar/MaxSupportedDateTime/japanesecalendar_minmax.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,39 +1,48 @@ | ||
| // The following code example gets the minimum date and the maximum date of the calendar. | ||
|
|
||
| // <snippet1> | ||
| using System; | ||
| using System.Globalization; | ||
|
|
||
| public class SamplesCalendar { | ||
|
|
||
| public static void Main() { | ||
|
|
||
| // Create an instance of the calendar. | ||
| JapaneseCalendar myCal = new JapaneseCalendar(); | ||
| Console.WriteLine( myCal.ToString() ); | ||
|
|
||
| // Create an instance of the GregorianCalendar. | ||
| GregorianCalendar myGre = new GregorianCalendar(); | ||
|
|
||
| // Display the MinSupportedDateTime and its equivalent in the GregorianCalendar. | ||
| DateTime myMin = myCal.MinSupportedDateTime; | ||
| Console.Write( "MinSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal.GetMonth(myMin), myCal.GetDayOfMonth(myMin), myCal.GetYear(myMin) ); | ||
| Console.WriteLine( " (in Gregorian, {0:D2}/{1:D2}/{2:D4})", myGre.GetMonth(myMin), myGre.GetDayOfMonth(myMin), myGre.GetYear(myMin) ); | ||
|
|
||
| // Display the MaxSupportedDateTime and its equivalent in the GregorianCalendar. | ||
| DateTime myMax = myCal.MaxSupportedDateTime; | ||
| Console.Write( "MaxSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal.GetMonth(myMax), myCal.GetDayOfMonth(myMax), myCal.GetYear(myMax) ); | ||
| Console.WriteLine( " (in Gregorian, {0:D2}/{1:D2}/{2:D4})", myGre.GetMonth(myMax), myGre.GetDayOfMonth(myMax), myGre.GetYear(myMax) ); | ||
| } | ||
| } | ||
|
|
||
| // <snippet1> | ||
| // Create an instance of the calendar. | ||
| JapaneseCalendar myCal = new(); | ||
| Console.WriteLine(myCal.ToString()); | ||
|
|
||
| // Create an instance of the GregorianCalendar. | ||
| GregorianCalendar myGre = new(); | ||
|
|
||
| // Display the MinSupportedDateTime and its equivalent in the GregorianCalendar. | ||
| DateTime myMin = myCal.MinSupportedDateTime; | ||
| Console.Write( | ||
| "MinSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", | ||
| myCal.GetMonth(myMin), | ||
| myCal.GetDayOfMonth(myMin), | ||
| myCal.GetYear(myMin)); | ||
| Console.WriteLine( | ||
| " (in Gregorian, {0:D2}/{1:D2}/{2:D4})", | ||
| myGre.GetMonth(myMin), | ||
| myGre.GetDayOfMonth(myMin), | ||
| myGre.GetYear(myMin)); | ||
|
|
||
| // Display the MaxSupportedDateTime and its equivalent in the GregorianCalendar. | ||
| DateTime myMax = myCal.MaxSupportedDateTime; | ||
| Console.Write( | ||
| "MaxSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", | ||
| myCal.GetMonth(myMax), | ||
| myCal.GetDayOfMonth(myMax), | ||
| myCal.GetYear(myMax)); | ||
| Console.WriteLine( | ||
| " (in Gregorian, {0:D2}/{1:D2}/{2:D4})", | ||
| myGre.GetMonth(myMax), | ||
| myGre.GetDayOfMonth(myMax), | ||
| myGre.GetYear(myMax)); | ||
|
|
||
| /* | ||
| This code produces the following output. | ||
| This code produces the following output on .NET 11. | ||
|
|
||
| System.Globalization.JapaneseCalendar | ||
| MinSupportedDateTime: 09/08/0001 (in Gregorian, 09/08/1868) | ||
| MaxSupportedDateTime: 12/31/8011 (in Gregorian, 12/31/9999) | ||
| MinSupportedDateTime: 10/23/0001 (in Gregorian, 10/23/1868) | ||
| MaxSupportedDateTime: 12/31/7981 (in Gregorian, 12/31/9999) | ||
|
|
||
| */ | ||
| // </snippet1> |
8 changes: 8 additions & 0 deletions
8
...ets/visualbasic/System.Globalization/JapaneseCalendar/MaxSupportedDateTime/Project.vbproj
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>net10.0</TargetFramework> | ||
gewarren marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </PropertyGroup> | ||
|
|
||
| </Project> | ||
77 changes: 45 additions & 32 deletions
77
...sic/System.Globalization/JapaneseCalendar/MaxSupportedDateTime/japanesecalendar_minmax.vb
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,38 +1,51 @@ | ||
| ' The following code example gets the minimum date and the maximum date of the calendar. | ||
|
|
||
| ' <snippet1> | ||
| Imports System.Globalization | ||
|
|
||
| Public Class SamplesCalendar | ||
|
|
||
| Public Shared Sub Main() | ||
|
|
||
| ' Create an instance of the calendar. | ||
| Dim myCal As New JapaneseCalendar() | ||
| Console.WriteLine(myCal.ToString()) | ||
|
|
||
| ' Create an instance of the GregorianCalendar. | ||
| Dim myGre As New GregorianCalendar() | ||
|
|
||
| ' Display the MinSupportedDateTime and its equivalent in the GregorianCalendar. | ||
| Dim myMin As DateTime = myCal.MinSupportedDateTime | ||
| Console.Write("MinSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal.GetMonth(myMin), myCal.GetDayOfMonth(myMin), myCal.GetYear(myMin)) | ||
| Console.WriteLine(" (in Gregorian, {0:D2}/{1:D2}/{2:D4})", myGre.GetMonth(myMin), myGre.GetDayOfMonth(myMin), myGre.GetYear(myMin)) | ||
|
|
||
| ' Display the MaxSupportedDateTime and its equivalent in the GregorianCalendar. | ||
| Dim myMax As DateTime = myCal.MaxSupportedDateTime | ||
| Console.Write("MaxSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", myCal.GetMonth(myMax), myCal.GetDayOfMonth(myMax), myCal.GetYear(myMax)) | ||
| Console.WriteLine(" (in Gregorian, {0:D2}/{1:D2}/{2:D4})", myGre.GetMonth(myMax), myGre.GetDayOfMonth(myMax), myGre.GetYear(myMax)) | ||
|
|
||
| End Sub | ||
| Public Class SamplesCalendar | ||
|
|
||
| Public Shared Sub Main() | ||
| ' <snippet1> | ||
| ' Create an instance of the calendar. | ||
| Dim myCal As New JapaneseCalendar() | ||
| Console.WriteLine(myCal.ToString()) | ||
|
|
||
| ' Create an instance of the GregorianCalendar. | ||
| Dim myGre As New GregorianCalendar() | ||
|
|
||
| ' Display the MinSupportedDateTime and its equivalent in the GregorianCalendar. | ||
| Dim myMin As Date = myCal.MinSupportedDateTime | ||
| Console.Write( | ||
| "MinSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", | ||
| myCal.GetMonth(myMin), | ||
| myCal.GetDayOfMonth(myMin), | ||
| myCal.GetYear(myMin)) | ||
| Console.WriteLine( | ||
| " (in Gregorian, {0:D2}/{1:D2}/{2:D4})", | ||
| myGre.GetMonth(myMin), | ||
| myGre.GetDayOfMonth(myMin), | ||
| myGre.GetYear(myMin)) | ||
|
|
||
| ' Display the MaxSupportedDateTime and its equivalent in the GregorianCalendar. | ||
| Dim myMax As Date = myCal.MaxSupportedDateTime | ||
| Console.Write( | ||
| "MaxSupportedDateTime: {0:D2}/{1:D2}/{2:D4}", | ||
| myCal.GetMonth(myMax), | ||
| myCal.GetDayOfMonth(myMax), | ||
| myCal.GetYear(myMax)) | ||
| Console.WriteLine( | ||
| " (in Gregorian, {0:D2}/{1:D2}/{2:D4})", | ||
| myGre.GetMonth(myMax), | ||
| myGre.GetDayOfMonth(myMax), | ||
| myGre.GetYear(myMax)) | ||
|
|
||
| 'This code produces the following output on .NET 11. | ||
| ' | ||
| 'System.Globalization.JapaneseCalendar | ||
| 'MinSupportedDateTime: 10/23/0001 (in Gregorian, 10/23/1868) | ||
| 'MaxSupportedDateTime: 12/31/7981 (in Gregorian, 12/31/9999) | ||
| ' </snippet1> | ||
BillWagner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| End Sub | ||
|
|
||
| End Class | ||
|
|
||
|
|
||
| 'This code produces the following output. | ||
| ' | ||
| 'System.Globalization.JapaneseCalendar | ||
| 'MinSupportedDateTime: 09/08/0001 (in Gregorian, 09/08/1868) | ||
| 'MaxSupportedDateTime: 12/31/8011 (in Gregorian, 12/31/9999) | ||
|
|
||
| ' </snippet1> | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.