public static double ToJulianDay(int year, int month, double day) { double jd; if (year > REFORM_YEAR) { jd = GregorianCalendar.ToJulianDay(year, month, day); } else if (year < REFORM_YEAR) { jd = JulianCalendar.ToJulianDay(year, month, day); } else if (month > REFORM_MONTH) { jd = GregorianCalendar.ToJulianDay(year, month, day); } else if (month < REFORM_MONTH) { jd = JulianCalendar.ToJulianDay(year, month, day); } else if (day >= 15.0) { jd = GregorianCalendar.ToJulianDay(year, month, day); } else if (day < 5.0) { jd = JulianCalendar.ToJulianDay(year, month, day); } else { throw new ArgumentOutOfRangeException("Invalid date: Date cannot be between Oct 4, 1582 and Oct 15, 1582"); } return(jd); }
public static Date FromJulianDay(double JD) => (JD < REFORM_JULIAN_DAY) ? JulianCalendar.FromJulianDay(JD) : GregorianCalendar.FromJulianDay(JD);
public static bool IsLeapYear(int year) => year <= REFORM_YEAR?JulianCalendar.IsLeapYear(year) : GregorianCalendar.IsLeapYear(year);
private JulianCalendar(JulianCalendar date) : base(date) { }