Skip to content
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

Update Value of TwoDigitYearMax to 2049 #76848

Merged
merged 17 commits into from
Oct 22, 2022
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ public class ThaiBuddhistCalendarToFourDigitYear
public void ToFourDigitYear(int year)
{
ThaiBuddhistCalendar calendar = new ThaiBuddhistCalendar();
calendar.TwoDigitYearMax = 2029;
calendar.TwoDigitYearMax = 2049;
if (year > 99)
{
Assert.Equal(year, calendar.ToFourDigitYear(year));
}
else if (year > 29)
else if (year > 49)
{
Assert.Equal(year + 1900, calendar.ToFourDigitYear(year));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -650,10 +650,10 @@ internal virtual bool IsValidDay(int year, int month, int day, int era)
/// Returns and assigns the maximum value to represent a two digit year.
/// This value is the upper boundary of a 100 year range that allows a
/// two digit year to be properly translated to a four digit year.
/// For example, if 2029 is the upper boundary, then a two digit value of
/// 30 should be interpreted as 1930 while a two digit value of 29 should
/// be interpreted as 2029. In this example, the 100 year range would be
/// from 1930-2029. See ToFourDigitYear().
/// For example, if 2049 is the upper boundary, then a two digit value of
/// 30 should be interpreted as 1950 while a two digit value of 49 should
/// be interpreted as 2049. In this example, the 100 year range would be
/// from 1950-2049. See ToFourDigitYear().
/// </summary>
public virtual int TwoDigitYearMax
{
Expand All @@ -667,9 +667,9 @@ public virtual int TwoDigitYearMax

/// <summary>
/// Converts the year value to the appropriate century by using the
/// TwoDigitYearMax property. For example, if the TwoDigitYearMax value is 2029,
/// then a two digit value of 30 will get converted to 1930 while a two digit
/// value of 29 will get converted to 2029.
/// TwoDigitYearMax property. For example, if the TwoDigitYearMax value is 2049,
/// then a two digit value of 50 will get converted to 1950 while a two digit
/// value of 49 will get converted to 2049.
/// </summary>
public virtual int ToFourDigitYear(int year)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ internal sealed partial class CalendarData
internal string[] saLeapYearMonthNames = null!; // Multiple strings for the month names in a leap year.

// Integers at end to make marshaller happier
internal int iTwoDigitYearMax = 2029; // Max 2 digit year (for Y2K bug data entry)
internal int iTwoDigitYearMax = 2049; // Max 2 digit year (for Y2K bug data entry)
danmoseley marked this conversation as resolved.
Show resolved Hide resolved
danmoseley marked this conversation as resolved.
Show resolved Hide resolved
private int iCurrentEra; // current era # (usually 1)

// Use overrides?
Expand All @@ -66,7 +66,7 @@ private static CalendarData CreateInvariant()
invariant.sNativeName = "Gregorian Calendar"; // Calendar Name

// Year
invariant.iTwoDigitYearMax = 2029; // Max 2 digit year (for Y2K bug data entry)
invariant.iTwoDigitYearMax = 2049; // Max 2 digit year (for Y2K bug data entry)
cdbullard marked this conversation as resolved.
Show resolved Hide resolved
invariant.iCurrentEra = 1; // Current era #

// Formats
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ public override bool IsLeapYear(int year, int era)
return InternalIsLeapYear(year);
}

private const int DefaultGregorianTwoDigitYearMax = 2029;
private const int DefaultGregorianTwoDigitYearMax = 2049;
danmoseley marked this conversation as resolved.
Show resolved Hide resolved

public override int TwoDigitYearMax
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ internal override bool TryToDateTime(int year, int month, int day, int hour, int
return DateTime.TryCreate(year, month, day, hour, minute, second, millisecond, out result);
}

private const int DefaultTwoDigitYearMax = 2029;
private const int DefaultTwoDigitYearMax = 2049;

public override int TwoDigitYearMax
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class JulianCalendar : Calendar
public JulianCalendar()
{
// There is no system setting of TwoDigitYear max, so set the value here.
_twoDigitYearMax = 2029;
_twoDigitYearMax = 2049;
}

internal override CalendarId ID => CalendarId.JULIAN;
Expand Down