Skip to content

Commit 54c0989

Browse files
authored
Update getSolarMidnight to use astronomical calc
Adding to the work done in fdf6c55 that supported astronomical noon, this change adds the same support to the experimental getSolarMidnight(). This allows calculations in the Arctic and Antarctic, and slightly improves accuracy.
1 parent 6be27e2 commit 54c0989

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/main/java/com/kosherjava/zmanim/ComplexZmanimCalendar.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Zmanim Java API
3-
* Copyright (C) 2004-2022 Eliyahu Hershfeld
3+
* Copyright (C) 2004-2023 Eliyahu Hershfeld
44
*
55
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
66
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
@@ -10,7 +10,7 @@
1010
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
1111
* details.
1212
* You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to
13-
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA,
13+
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA,
1414
* or connect to: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
1515
*/
1616
package com.kosherjava.zmanim;
@@ -106,7 +106,7 @@
106106
* <h2>Documentation from the {@link ZmanimCalendar} parent class</h2>
107107
* {@inheritDoc}
108108
*
109-
* @author &copy; Eliyahu Hershfeld 2004 - 2022
109+
* @author &copy; Eliyahu Hershfeld 2004 - 2023
110110
*/
111111
public class ComplexZmanimCalendar extends ZmanimCalendar {
112112

@@ -3797,9 +3797,7 @@ public Date getSofZmanBiurChametzMGA16Point1Degrees() {
37973797
public Date getSolarMidnight() {
37983798
ZmanimCalendar clonedCal = (ZmanimCalendar) clone();
37993799
clonedCal.getCalendar().add(Calendar.DAY_OF_MONTH, 1);
3800-
Date sunset = getSeaLevelSunset();
3801-
Date sunrise = clonedCal.getSeaLevelSunrise();
3802-
return getTimeOffset(sunset, getTemporalHour(sunset, sunrise) * 6);
3800+
return getTimeOffset(getChatzos(), clonedCal.getChatzos().getTime() - getChatzos().getTime());
38033801
}
38043802

38053803
/**
@@ -3996,6 +3994,7 @@ public Date getSofZmanBiurChametzBaalHatanya() {
39963994
* sea level solar hours} after {@link #getSunriseBaalHatanya() <em>netz amiti</em> (sunrise)}. This calculation is based
39973995
* on the opinion of the Baal Hatanya that the day is calculated from sunrise to sunset. This returns the time 6.5
39983996
* * {@link #getShaahZmanisBaalHatanya()} after {@link #getSunriseBaalHatanya() <em>netz amiti</em> ("real" sunrise)}.
3997+
*
39993998
* @see #getMinchaGedola(Date, Date)
40003999
* @see #getShaahZmanisBaalHatanya()
40014000
* @see #getMinchaKetanaBaalHatanya()

0 commit comments

Comments
 (0)