diff --git a/src/main/java/com/kosherjava/zmanim/hebrewcalendar/HebrewDateFormatter.java b/src/main/java/com/kosherjava/zmanim/hebrewcalendar/HebrewDateFormatter.java index 71fa8f12..3c458cc5 100644 --- a/src/main/java/com/kosherjava/zmanim/hebrewcalendar/HebrewDateFormatter.java +++ b/src/main/java/com/kosherjava/zmanim/hebrewcalendar/HebrewDateFormatter.java @@ -772,15 +772,15 @@ public String formatMonth(JewishDate jewishDate) { final int month = jewishDate.getJewishMonth(); if (isHebrewFormat()) { if (jewishDate.isJewishLeapYear() && month == JewishDate.ADAR) { - return hebrewMonths[13] + (useGershGershayim ? GERESH : ""); // return Adar I, not Adar in a leap year + return hebrewMonths[JewishDate.ADAR_II] + (useGershGershayim ? GERESH : ""); // return Adar I, not Adar in a leap year } else if (jewishDate.isJewishLeapYear() && month == JewishDate.ADAR_II) { - return hebrewMonths[12] + (useGershGershayim ? GERESH : ""); + return hebrewMonths[JewishDate.ADAR] + (useGershGershayim ? GERESH : ""); } else { return hebrewMonths[month - 1]; } } else { if (jewishDate.isJewishLeapYear() && month == JewishDate.ADAR) { - return transliteratedMonths[13]; // return Adar I, not Adar in a leap year + return transliteratedMonths[JewishDate.ADAR_II]; // return Adar I, not Adar in a leap year } else { return transliteratedMonths[month - 1]; } diff --git a/src/main/java/com/kosherjava/zmanim/hebrewcalendar/JewishDate.java b/src/main/java/com/kosherjava/zmanim/hebrewcalendar/JewishDate.java index e38af3e8..a3cb80ce 100644 --- a/src/main/java/com/kosherjava/zmanim/hebrewcalendar/JewishDate.java +++ b/src/main/java/com/kosherjava/zmanim/hebrewcalendar/JewishDate.java @@ -153,7 +153,7 @@ public class JewishDate implements Comparable, Cloneable { /** The number of chalakim (1080) in an hour.*/ private static final int CHALAKIM_PER_HOUR = 1080; /** The number of chalakim (25,920) in a 24-hour day .*/ - private static final int CHALAKIM_PER_DAY = 25920; // 24 * 1080 + private static final long CHALAKIM_PER_DAY = 25920; // 24 * 1080 /** The number of chalakim in an average Jewish month. A month has 29 days, 12 hours and 793 * chalakim (44 minutes and 3.3 seconds) for a total of 765,433 chalakim*/ private static final long CHALAKIM_PER_MONTH = 765433; // (29 * 24 + 12) * 1080 + 793 @@ -460,8 +460,8 @@ private static int getLastMonthOfJewishYear(int year) { */ public static int getJewishCalendarElapsedDays(int year) { long chalakimSince = getChalakimSinceMoladTohu(year, TISHREI); - int moladDay = (int) (chalakimSince / (long) CHALAKIM_PER_DAY); - int moladParts = (int) (chalakimSince - moladDay * (long) CHALAKIM_PER_DAY); + int moladDay = (int) (chalakimSince / CHALAKIM_PER_DAY); + int moladParts = (int) (chalakimSince - moladDay * CHALAKIM_PER_DAY); // delay Rosh Hashana for the 4 dechiyos return addDechiyos(year, moladDay, moladParts); } @@ -908,8 +908,8 @@ private static int moladToAbsDate(long chalakim) { public JewishDate(long molad) { absDateToDate(moladToAbsDate(molad)); // long chalakimSince = getChalakimSinceMoladTohu(year, TISHREI);// tishrei - int conjunctionDay = (int) (molad / (long) CHALAKIM_PER_DAY); - int conjunctionParts = (int) (molad - conjunctionDay * (long) CHALAKIM_PER_DAY); + int conjunctionDay = (int) (molad / CHALAKIM_PER_DAY); + int conjunctionParts = (int) (molad - conjunctionDay * CHALAKIM_PER_DAY); setMoladTime(conjunctionParts); }