mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-10-01 16:47:15 -05:00
Fixed errors in implementation
This commit is contained in:
@@ -116,7 +116,7 @@ public override string CardTitle
|
||||
if (value.HasValue)
|
||||
{
|
||||
// Only update the properties if a value is provided.
|
||||
Year = (ushort)value.Value.Year;
|
||||
Year = (ushort)(value.Value.Year - 2000);
|
||||
Month = (byte)value.Value.Month;
|
||||
Day = (byte)value.Value.Day;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public WC6(byte[] data = null)
|
||||
if (value.HasValue)
|
||||
{
|
||||
// Only update the properties if a value is provided.
|
||||
Year = (ushort)value.Value.Year;
|
||||
Year = (ushort)(value.Value.Year - 2000);
|
||||
Month = (byte)value.Value.Month;
|
||||
Day = (byte)value.Value.Day;
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ public byte[] Write()
|
||||
if (value.HasValue)
|
||||
{
|
||||
// Only update the properties if a value is provided.
|
||||
Met_Year = value.Value.Year;
|
||||
Met_Year = value.Value.Year - 2000;
|
||||
Met_Month = value.Value.Month;
|
||||
Met_Day = value.Value.Day;
|
||||
}
|
||||
@@ -200,7 +200,7 @@ public byte[] Write()
|
||||
if (value.HasValue)
|
||||
{
|
||||
// Only update the properties if a value is provided.
|
||||
Egg_Year = value.Value.Year;
|
||||
Egg_Year = value.Value.Year - 2000;
|
||||
Egg_Month = value.Value.Month;
|
||||
Egg_Day = value.Value.Day;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public static partial class Util
|
||||
/// <returns>A boolean indicating whether or not the date is valid.</returns>
|
||||
public static bool IsDateValid(int year, int month, int day)
|
||||
{
|
||||
return !(year < 0 || year > DateTime.MaxValue.Year || month < 1 || month > 12 || day < 1 || day > DateTime.DaysInMonth(year, day));
|
||||
return !(year < 0 || year > DateTime.MaxValue.Year || month < 1 || month > 12 || day < 1 || day > DateTime.DaysInMonth(year, month));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -28,7 +28,7 @@ public static bool IsDateValid(int year, int month, int day)
|
||||
/// <returns>A boolean indicating whether or not the date is valid.</returns>
|
||||
public static bool IsDateValid(uint year, uint month, uint day)
|
||||
{
|
||||
return !(year < 0 || year > DateTime.MaxValue.Year || month < 1 || month > 12 || day < 1 || day > DateTime.DaysInMonth((int)year, (int)day));
|
||||
return !(year < 0 || year > DateTime.MaxValue.Year || month < 1 || month > 12 || day < 1 || day > DateTime.DaysInMonth((int)year, (int)month));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user