Fixed errors in implementation

This commit is contained in:
Evan Dixon
2016-08-10 09:07:16 -05:00
parent f0c72abafc
commit 4669551d77
4 changed files with 6 additions and 6 deletions

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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));
}
}
}