/// <summary> /// Creates a Jewish date that corresponds to the given Gregorian date in the given location. Cut-off time is sunset. /// </summary> /// <param name="date">The Gregorian date from which to create the Jewish Date</param> /// <param name="location">The location. This will be used to determine the time of sunset.</param> public JewishDate(DateTime date, Location location) { int abs = JewishDateCalculations.GetAbsoluteFromGregorianDate(date); var zman = new Zmanim(date, location); if (zman.GetShkia() <= date.TimeOfDay) { abs++; } this.SetFromAbsoluteDate(abs); this._gregorianDate = date; this.TimeOfDay = date.TimeOfDay; }
/// <summary> /// Creates a Jewish date that corresponds to the given Gregorian date /// </summary> /// <param name="date">The Gregorian date from which to create the Jewish Date</param> public JewishDate(DateTime date) { this.SetFromAbsoluteDate(JewishDateCalculations.GetAbsoluteFromGregorianDate(date)); this._gregorianDate = date; this.TimeOfDay = date.TimeOfDay; }