Skip to content

Commit 5075e61

Browse files
committed
Calendar constants.
1 parent 44f2655 commit 5075e61

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/main/java/com/kosherjava/zmanim/hebrewcalendar/HebrewDateFormatter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -772,15 +772,15 @@ public String formatMonth(JewishDate jewishDate) {
772772
final int month = jewishDate.getJewishMonth();
773773
if (isHebrewFormat()) {
774774
if (jewishDate.isJewishLeapYear() && month == JewishDate.ADAR) {
775-
return hebrewMonths[13] + (useGershGershayim ? GERESH : ""); // return Adar I, not Adar in a leap year
775+
return hebrewMonths[JewishDate.ADAR_II] + (useGershGershayim ? GERESH : ""); // return Adar I, not Adar in a leap year
776776
} else if (jewishDate.isJewishLeapYear() && month == JewishDate.ADAR_II) {
777-
return hebrewMonths[12] + (useGershGershayim ? GERESH : "");
777+
return hebrewMonths[JewishDate.ADAR] + (useGershGershayim ? GERESH : "");
778778
} else {
779779
return hebrewMonths[month - 1];
780780
}
781781
} else {
782782
if (jewishDate.isJewishLeapYear() && month == JewishDate.ADAR) {
783-
return transliteratedMonths[13]; // return Adar I, not Adar in a leap year
783+
return transliteratedMonths[JewishDate.ADAR_II]; // return Adar I, not Adar in a leap year
784784
} else {
785785
return transliteratedMonths[month - 1];
786786
}

src/main/java/com/kosherjava/zmanim/hebrewcalendar/JewishDate.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public class JewishDate implements Comparable<JewishDate>, Cloneable {
153153
/** The number of <em>chalakim</em> (1080) in an hour.*/
154154
private static final int CHALAKIM_PER_HOUR = 1080;
155155
/** The number of <em>chalakim</em> (25,920) in a 24-hour day .*/
156-
private static final int CHALAKIM_PER_DAY = 25920; // 24 * 1080
156+
private static final long CHALAKIM_PER_DAY = 25920; // 24 * 1080
157157
/** The number of <em>chalakim</em> in an average Jewish month. A month has 29 days, 12 hours and 793
158158
* <em>chalakim</em> (44 minutes and 3.3 seconds) for a total of 765,433 <em>chalakim</em>*/
159159
private static final long CHALAKIM_PER_MONTH = 765433; // (29 * 24 + 12) * 1080 + 793
@@ -460,8 +460,8 @@ private static int getLastMonthOfJewishYear(int year) {
460460
*/
461461
public static int getJewishCalendarElapsedDays(int year) {
462462
long chalakimSince = getChalakimSinceMoladTohu(year, TISHREI);
463-
int moladDay = (int) (chalakimSince / (long) CHALAKIM_PER_DAY);
464-
int moladParts = (int) (chalakimSince - moladDay * (long) CHALAKIM_PER_DAY);
463+
int moladDay = (int) (chalakimSince / CHALAKIM_PER_DAY);
464+
int moladParts = (int) (chalakimSince - moladDay * CHALAKIM_PER_DAY);
465465
// delay Rosh Hashana for the 4 dechiyos
466466
return addDechiyos(year, moladDay, moladParts);
467467
}
@@ -908,8 +908,8 @@ private static int moladToAbsDate(long chalakim) {
908908
public JewishDate(long molad) {
909909
absDateToDate(moladToAbsDate(molad));
910910
// long chalakimSince = getChalakimSinceMoladTohu(year, TISHREI);// tishrei
911-
int conjunctionDay = (int) (molad / (long) CHALAKIM_PER_DAY);
912-
int conjunctionParts = (int) (molad - conjunctionDay * (long) CHALAKIM_PER_DAY);
911+
int conjunctionDay = (int) (molad / CHALAKIM_PER_DAY);
912+
int conjunctionParts = (int) (molad - conjunctionDay * CHALAKIM_PER_DAY);
913913
setMoladTime(conjunctionParts);
914914
}
915915

0 commit comments

Comments
 (0)