public static void AssertNoOverflow(IHasDateComponents date, string target) { if (date.Year > DateTime.MaxValue.Year || date.Year < DateTime.MinValue.Year) { throw new ValueOverflowException($"Year component ({date.Year}) of this instance is not valid for a {target} instance."); } }
public static long ToEpochDays(this IHasDateComponents date) { return(ComputeEpochDays(date.Year, date.Month, date.Day)); }