Пример #1
0
 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.");
     }
 }
Пример #2
0
 public static long ToEpochDays(this IHasDateComponents date)
 {
     return(ComputeEpochDays(date.Year, date.Month, date.Day));
 }