using System;
namespace PKHeX.Core
{
public static partial class Util
{
///
/// Determines whether or not the given date components are valid.
///
/// The year of the date of which to check the validity.
/// The month of the date of which to check the validity.
/// The day of the date of which to check the validity.
/// A boolean indicating whether or not the date is valid.
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, month));
}
///
/// Determines whether or not the given date components are valid.
///
/// The year of the date of which to check the validity.
/// The month of the date of which to check the validity.
/// The day of the date of which to check the validity.
/// A boolean indicating whether or not the date is valid.
public static bool IsDateValid(uint year, uint month, uint day)
{
return year < int.MaxValue && month < int.MaxValue && day < int.MaxValue && IsDateValid((int)year, (int)month, (int)day);
}
}
}