Skip to content

Commit

Permalink
amended everything as per DM
Browse files Browse the repository at this point in the history
  • Loading branch information
Ely committed Jan 12, 2024
1 parent d9e041f commit d79922a
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ public Date getLocalMeanTime(double hours) {
}

/**
* Adjusts the <code>Calendar</code> to deal with edge cases where the location crosses the anti meridian.
* Adjusts the <code>Calendar</code> to deal with edge cases where the location crosses the antimeridian.
*
* @see GeoLocation#getAntimeridianAdjustment()
* @return the adjusted Calendar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1777,7 +1777,7 @@ public Date getSofZmanTfila2HoursBeforeChatzos() {
* and not 1/2 of a {@link #getShaahZmanisGra() <em>shaah zmanis</em>} after {@link #getChatzos() <em>chatzos</em>} as
* calculated by {@link #getMinchaGedola}. Some use this time to delay the start of <em>mincha</em> in the winter when
* 1/2 of a {@link #getShaahZmanisGra() <em>shaah zmanis</em>} is less than 30 minutes. See
* {@link #getMinchaGedolaGreaterThan30()} for a convenience method that returns the latter of the 2 calculations. One
* {@link #getMinchaGedolaGreaterThan30()} for a convenience method that returns the later of the 2 calculations. One
* should not use this time to start <em>mincha</em> before the standard {@link #getMinchaGedola() <em>mincha gedola</em>}.
* See Shulchan Aruch <a href="https://hebrewbooks.org/pdfpager.aspx?req=49624&st=&pgnum=291">Orach Chayim 234:1</a> and
* the Shaar Hatziyon <em>seif katan ches</em>. Since this calculation is a fixed 30 minutes of regular clock time after
Expand Down Expand Up @@ -1861,7 +1861,7 @@ public Date getMinchaGedola16Point1Degrees() {
* zmanis</em> after <em>chatzos</em> with <em>shaos zmaniyos</em> calculated based on a day starting 72 minutes before sunrise
* {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} and ending 13.5 minutes after sunset {@link
* #getTzaisGeonim3Point7Degrees() <em>tzais</em> 3.7&deg;}. <em>Mincha gedola</em> is the earliest time to pray <em>mincha</em>.
* The latter of this time or 30 clock minutes after <em>chatzos</em> is returned. See {@link #getMinchaGedolaGreaterThan30()}
* The later of this time or 30 clock minutes after <em>chatzos</em> is returned. See {@link #getMinchaGedolaGreaterThan30()}
* (though that calculation is based on <em>mincha gedola</em> GRA).
* For more information about <em>mincha gedola</em> see the documentation on {@link #getMinchaGedola() <em>mincha gedola</em>}.
* Since calculation of this <em>zman</em> involves <em>chatzos</em> that is offset from the center of the astronomical day,
Expand Down Expand Up @@ -1894,7 +1894,7 @@ public Date getMinchaGedolaAhavatShalom() {
* zmanis</em>), even if {@link #isUseAstronomicalChatzosForOtherZmanim()} is <code>false</code>, this <em>mincha</em> time
* may be affected by {@link #isUseAstronomicalChatzos()}.
*
* @return the <code>Date</code> of the latter of {@link #getMinchaGedola()} and {@link #getMinchaGedola30Minutes()}.
* @return the <code>Date</code> of the later of {@link #getMinchaGedola()} and {@link #getMinchaGedola30Minutes()}.
* If the calculation can't be computed such as in the Arctic Circle where there is at least one day a year
* where the sun does not rise, and one where it does not set, a <code>null</code> will be returned. See detailed
* explanation on top of the {@link AstronomicalCalendar} documentation.
Expand Down Expand Up @@ -4151,7 +4151,7 @@ public Date getMinchaGedolaBaalHatanya() {
* @todo Consider adjusting this to calculate the time as 30 clock or <em>zmaniyos </em> minutes after either {@link
* #getSunTransit() astronomical <em>chatzos</em>} or {@link #getChatzosAsHalfDay() <em>chatzos</em> as half a day}
* for {@link AstronomicalCalculator calculators} that support it, based on {@link #isUseAstronomicalChatzos()}.
* @return the <code>Date</code> of the latter of {@link #getMinchaGedolaBaalHatanya()} and {@link #getMinchaGedola30Minutes()}.
* @return the <code>Date</code> of the later of {@link #getMinchaGedolaBaalHatanya()} and {@link #getMinchaGedola30Minutes()}.
* If the calculation can't be computed such as in the Arctic Circle where there is at least one day a year
* where the sun does not rise, and one where it does not set, a <code>null</code> will be returned. See detailed
* explanation on top of the {@link AstronomicalCalendar} documentation.
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/kosherjava/zmanim/ZmanimCalendar.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public void setUseElevation(boolean useElevation) {

/**
* Is {@link #getSunTransit() astronomical <em>chatzos</em>} used for {@link #getChatzos()} for enhanced accuracy. For
* example as the day is lengthening, the second half of the day is longer than the first and astronomical <em>chatzos</em>
* example as the day lengthens, the second half of the day is longer than the first and astronomical <em>chatzos</em>
* would be a drop earlier than half of the time between sunrise and sunset.
*
* @todo In the future, if this is set to true, the following may change to enhance accuracy. {@link #getSofZmanShmaGRA()
Expand Down Expand Up @@ -183,7 +183,7 @@ public void setUseAstronomicalChatzos(boolean useAstronomicalChatzos) {
* Is astronomical <em>chatzos</em> used for <em>zmanim</em> calculations besides <em>chatzos</em> itself for enhanced
* accuracy. For example as the day is lengthening (as we approach spring season), the second half of the day is longer than
* the first and astronomical <em>chatzos</em> would be a drop earlier than half of the time between sunrise and sunset.
* Conversely, the second half of the day would be shorter in the season of fall as the days start getting shorter.
* Conversely, the second half of the day would be shorter in the 'fall' season as the days start getting shorter.
*
* @todo In the future, if this is set to true, the following may change to enhance accuracy. {@link #getSofZmanShmaGRA()
* <em>Sof zman Shma</em> GRA} would be calculated as 3 <em>shaos zmaniyos</em> after sunrise, but the <em>shaos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@ boolean isGregorianLeapYear(int year) {
}

/**
* The month, where 1 == January, 2 == February, etc... Note that this is different from the Java's Calendar class
* where January ==0
* The month, where 1 == January, 2 == February, etc... Note that this is different from Java's Calendar class
* where January == 0
*/
private int gregorianMonth;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ public static Daf getDafYomiYerushalmi(JewishCalendar calendar) {
}

/**
* Return the number of special days (Yom Kippur and Tisha Beav) That there are no Dafs in these days.
* From the last given number of days until given date
* Return the number of special days (Yom Kippur and Tisha Beav, where there are no dafim on these days),
* from the start date (as a <code>Calendar</code>) given until the end date (also as a <code>Calendar</code>).
*
* @param start start date to calculate
* @param end end date to calculate
* @return the number of special days
* @param start date to start calculating from
* @param end date to finish calculating at
* @return the number of special days between the start time and end time
*/
private static int getNumOfSpecialDays(Calendar start, Calendar end) {

Expand Down Expand Up @@ -153,7 +153,7 @@ private static int getNumOfSpecialDays(Calendar start, Calendar end) {
* @param end the end date
* @return if the date is between the start and end dates
*/
private static boolean isBetween( Calendar start, Calendar date, Calendar end ) {
private static boolean isBetween(Calendar start, Calendar date, Calendar end) {
return start.before(date) && end.after(date);
}

Expand All @@ -164,6 +164,6 @@ private static boolean isBetween( Calendar start, Calendar date, Calendar end )
* @return the number of days between the start and end dates
*/
private static long getDiffBetweenDays(Calendar start, Calendar end) {
return ( end.getTimeInMillis() - start.getTimeInMillis()) / DAY_MILIS;
return (end.getTimeInMillis() - start.getTimeInMillis()) / DAY_MILIS;
}
}
12 changes: 6 additions & 6 deletions src/main/java/com/kosherjava/zmanim/util/GeoLocation.java
Original file line number Diff line number Diff line change
Expand Up @@ -325,30 +325,30 @@ public long getLocalMeanTimeOffset() {
}

/**
* Adjust the date for <a href="https://en.wikipedia.org/wiki/180th_meridian">anti meridian</a> crossover. This is
* Adjust the date for <a href="https://en.wikipedia.org/wiki/180th_meridian">antimeridian</a> crossover. This is
* needed to deal with edge cases such as Samoa that use a different calendar date than expected based on their
* geographic location.
* <p>
* The actual Time Zone offset may deviate from the expected offset based on the longitude. Since the 'absolute time'
* calculations are always based on longitudinal offset from UTC for a given date, the date is presumed to only
* increase East of the Prime Meridian, and to only decrease West of it. For Time Zones that cross the anti meridian,
* increase East of the Prime Meridian, and to only decrease West of it. For Time Zones that cross the antimeridian,
* the date will be artificially adjusted before calculation to conform with this presumption.
* <p>
* For example, Apia, Samoa with a longitude of -171.75 uses a local offset of +14:00. When calculating sunrise for
* 2018-02-03, the calculator should operate using 2018-02-02 since the expected zone is -11. After determining the
* UTC time, the local DST offset of <a href="https://en.wikipedia.org/wiki/UTC%2B14:00">UTC+14:00</a> should be applied
* to bring the date back to 2018-02-03.
*
* @return the number of days to adjust the date This will typically be 0 unless the date crosses the anti meridian
* @return the number of days to adjust the date This will typically be 0 unless the date crosses the antimeridian
*/
public int getAntimeridianAdjustment() {
double localHoursOffset = getLocalMeanTimeOffset() / (double)HOUR_MILLIS;

if (localHoursOffset >= 20){// if the offset is 20 hours or more in the future (never expected anywhere other
// than a location using a timezone across the anti meridian to the east such as Samoa)
// than a location using a timezone across the antimeridian to the east such as Samoa)
return 1; // roll the date forward a day
} else if (localHoursOffset <= -20) { // if the offset is 20 hours or more in the past (no current location is known
//that crosses the anti meridian to the west, but better safe than sorry)
//that crosses the antimeridian to the west, but better safe than sorry)
return -1; // roll the date back a day
}
return 0; //99.999% of the world will have no adjustment
Expand Down Expand Up @@ -530,7 +530,7 @@ public double getRhumbLineDistance(GeoLocation location) {

/**
* A method that returns an XML formatted <code>String</code> representing the serialized <code>Object</code>. Very
* similar to the toString method but the return value is a xml format. The format currently used (subject to
* similar to the toString method but the return value is in an xml format. The format currently used (subject to
* change) is:
*
* <pre>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/kosherjava/zmanim/util/Zman.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.util.Date;

/**
* A wrapper class for an astronomical times / <em>zmanim</em> that is mostly intended to allow sorting collections of astronomical times.
* A wrapper class for astronomical times / <em>zmanim</em> that is mostly intended to allow sorting collections of astronomical times.
* It has fields for both date/time and duration based <em>zmanim</em>, name / labels as well as a longer description or explanation of a
* <em>zman</em>.
* <p>
Expand Down

0 comments on commit d79922a

Please sign in to comment.