Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renamed Cheshvan to Marcheshvan #241

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,12 @@ public void setLongWeekFormat(boolean longWeekFormat) {
private static final String GERSHAYIM = "\u05F4";

/**
* Transliterated month names.  Defaults to ["Nissan", "Iyar", "Sivan", "Tammuz", "Av", "Elul", "Tishrei", "Cheshvan",
* Transliterated month names.  Defaults to ["Nissan", "Iyar", "Sivan", "Tammuz", "Av", "Elul", "Tishrei", "Marcheshvan",
* "Kislev", "Teves", "Shevat", "Adar", "Adar II", "Adar I" ].
* @see #getTransliteratedMonthList()
* @see #setTransliteratedMonthList(String[])
*/
private String[] transliteratedMonths = { "Nissan", "Iyar", "Sivan", "Tammuz", "Av", "Elul", "Tishrei", "Cheshvan",
private String[] transliteratedMonths = { "Nissan", "Iyar", "Sivan", "Tammuz", "Av", "Elul", "Tishrei", "Marcheshvan",
"Kislev", "Teves", "Shevat", "Adar", "Adar II", "Adar I" };

/**
Expand Down Expand Up @@ -581,7 +581,7 @@ public void setHebrewOmerPrefix(String hebrewOmerPrefix) {
* "Adar", "Adar II", "Adar I"
*
* @return the array of months beginning in Nissan and ending in "Adar", "Adar II", "Adar I". The default list is
* currently ["Nissan", "Iyar", "Sivan", "Tammuz", "Av", "Elul", "Tishrei", "Cheshvan", "Kislev", "Teves",
* currently ["Nissan", "Iyar", "Sivan", "Tammuz", "Av", "Elul", "Tishrei", "Marcheshvan", "Kislev", "Teves",
* "Shevat", "Adar", "Adar II", "Adar I"].
* @see #setTransliteratedMonthList(String[])
*/
Expand All @@ -595,7 +595,7 @@ public String[] getTransliteratedMonthList() {
*
* @param transliteratedMonths
* an array of 14 month names that defaults to ["Nissan", "Iyar", "Sivan", "Tamuz", "Av", "Elul", "Tishrei",
* "Heshvan", "Kislev", "Tevet", "Shevat", "Adar", "Adar II", "Adar I"].
* "Marheshvan", "Kislev", "Tevet", "Shevat", "Adar", "Adar II", "Adar I"].
* @see #getTransliteratedMonthList()
*/
public void setTransliteratedMonthList(String[] transliteratedMonths) {
Expand All @@ -605,14 +605,14 @@ public void setTransliteratedMonthList(String[] transliteratedMonths) {
/**
* Unicode list of Hebrew months in the following format <code>["\u05E0\u05D9\u05E1\u05DF","\u05D0\u05D9\u05D9\u05E8",
* "\u05E1\u05D9\u05D5\u05DF","\u05EA\u05DE\u05D5\u05D6","\u05D0\u05D1","\u05D0\u05DC\u05D5\u05DC",
* "\u05EA\u05E9\u05E8\u05D9","\u05D7\u05E9\u05D5\u05DF","\u05DB\u05E1\u05DC\u05D5","\u05D8\u05D1\u05EA",
* "\u05EA\u05E9\u05E8\u05D9","\u05DE\u05E8\u05D7\u05E9\u05D5\u05DF","\u05DB\u05E1\u05DC\u05D5","\u05D8\u05D1\u05EA",
* "\u05E9\u05D1\u05D8","\u05D0\u05D3\u05E8","\u05D0\u05D3\u05E8 \u05D1","\u05D0\u05D3\u05E8 \u05D0"]</code>
*
* @see #formatMonth(JewishDate)
*/
private static final String[] hebrewMonths = { "\u05E0\u05D9\u05E1\u05DF", "\u05D0\u05D9\u05D9\u05E8",
"\u05E1\u05D9\u05D5\u05DF", "\u05EA\u05DE\u05D5\u05D6", "\u05D0\u05D1", "\u05D0\u05DC\u05D5\u05DC",
"\u05EA\u05E9\u05E8\u05D9", "\u05D7\u05E9\u05D5\u05DF", "\u05DB\u05E1\u05DC\u05D5",
"\u05EA\u05E9\u05E8\u05D9", "\u05DE\u05E8\u05D7\u05E9\u05D5\u05DF", "\u05DB\u05E1\u05DC\u05D5",
"\u05D8\u05D1\u05EA", "\u05E9\u05D1\u05D8", "\u05D0\u05D3\u05E8", "\u05D0\u05D3\u05E8 \u05D1",
"\u05D0\u05D3\u05E8 \u05D0" };

Expand Down Expand Up @@ -845,7 +845,7 @@ private static String formatMolad(long moladChalakim) {

/**
* Returns the kviah in the traditional 3 letter Hebrew format where the first letter represents the day of week of
* Rosh Hashana, the second letter represents the lengths of Cheshvan and Kislev ({@link JewishDate#SHELAIMIM
* Rosh Hashana, the second letter represents the lengths of Marcheshvan and Kislev ({@link JewishDate#SHELAIMIM
* Shelaimim} , {@link JewishDate#KESIDRAN Kesidran} or {@link JewishDate#CHASERIM Chaserim}) and the 3rd letter
* represents the day of week of Pesach. For example 5729 (1969) would return &#x5D1;&#x5E9;&#x5D4; (Rosh Hashana on
* Monday, Shelaimim, and Pesach on Thursday), while 5771 (2011) would return &#x5D4;&#x5E9;&#x5D2; (Rosh Hashana on
Expand All @@ -858,7 +858,7 @@ private static String formatMolad(long moladChalakim) {
*/
public String getFormattedKviah(int jewishYear) {
JewishDate jewishDate = new JewishDate(jewishYear, JewishDate.TISHREI, 1); // set date to Rosh Hashana
int kviah = jewishDate.getCheshvanKislevKviah();
int kviah = jewishDate.getMarcheshvanKislevKviah();
int roshHashanaDayOfWeek = jewishDate.getDayOfWeek();
String returnValue = formatHebrewNumber(roshHashanaDayOfWeek);
returnValue += (kviah == JewishDate.CHASERIM ? "\u05D7" : kviah == JewishDate.SHELAIMIM ? "\u05E9" : "\u05DB");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public class JewishCalendar extends JewishDate {
public static final int YOM_KIPPUR_KATAN = 36;

/**
* The Monday, Thursday and Monday after the first <em>Shabbos</em> after <em>Rosh Chodesh Cheshvan</em> and <em>Iyar</em>) are BeHab
* The Monday, Thursday and Monday after the first <em>Shabbos</em> after <em>Rosh Chodesh Marcheshvan</em> and <em>Iyar</em>) are BeHab
* days. This constant is not actively in use.
* @see #isBeHaB()
*/
Expand Down Expand Up @@ -409,7 +409,7 @@ private int getParshaYearType() {
}
return 6;
}
if (isCheshvanLong()) { //BaSh
if (isMarcheshvanLong()) { //BaSh
if (getInIsrael()) {
return 15;
}
Expand All @@ -425,15 +425,15 @@ private int getParshaYearType() {
if (isKislevShort()) { //HaCh
return 8;
}
if (isCheshvanLong()) { //HaSh
if (isMarcheshvanLong()) { //HaSh
return 9;
}
break;
case Calendar.SATURDAY:
if (isKislevShort()) { //ZaCh
return 10;
}
if (isCheshvanLong()) { //ZaSh
if (isMarcheshvanLong()) { //ZaSh
if (getInIsrael()) {
return 16;
}
Expand All @@ -447,7 +447,7 @@ private int getParshaYearType() {
if (isKislevShort()) { //BaCh
return 0;
}
if (isCheshvanLong()) { //BaSh
if (isMarcheshvanLong()) { //BaSh
if (getInIsrael()) {
return 12;
}
Expand All @@ -460,7 +460,7 @@ private int getParshaYearType() {
}
return 1;
case Calendar.THURSDAY:
if (isCheshvanLong()) { //HaSh
if (isMarcheshvanLong()) { //HaSh
return 3;
}
if (!isKislevShort()) { //Hak
Expand All @@ -474,7 +474,7 @@ private int getParshaYearType() {
if (isKislevShort()) { //ZaCh
return 4;
}
if (isCheshvanLong()) { //ZaSh
if (isMarcheshvanLong()) { //ZaSh
return 5;
}
break;
Expand Down Expand Up @@ -1047,7 +1047,7 @@ public boolean isErevRoshChodesh() {

/**
* Returns true if the current day is <em>Yom Kippur Katan</em>. Returns false for <em>Erev Rosh Hashana</em>,
* <em>Erev Rosh Chodesh Cheshvan</em>, <em>Teves</em> and <em>Iyyar</em>. If <em>Erev Rosh Chodesh</em> occurs
* <em>Erev Rosh Chodesh Marcheshvan</em>, <em>Teves</em> and <em>Iyyar</em>. If <em>Erev Rosh Chodesh</em> occurs
* on a Friday or <em>Shabbos</em>, <em>Yom Kippur Katan</em> is moved back to Thursday.
*
* @return true if the current day is <em>Erev Rosh Chodesh</em>. Returns false for <em>Erev Rosh Hashana</em>.
Expand All @@ -1069,7 +1069,7 @@ public boolean isYomKippurKatan() {

/**
* The Monday, Thursday and Monday after the first <em>Shabbos</em> after {@link #isRoshChodesh() <em>Rosh Chodesh</em>}
* {@link JewishDate#CHESHVAN <em>Cheshvan</em>} and {@link JewishDate#IYAR <em>Iyar</em>} are <a href=
* {@link JewishDate#CHESHVAN <em>Marcheshvan</em>} and {@link JewishDate#IYAR <em>Iyar</em>} are <a href=
* "https://outorah.org/p/41334/"> <em>BeHaB</em></a> days. If the last Monday of Iyar's BeHaB coincides with {@link
* #PESACH_SHENI <em>Pesach Sheni</em>}, the method currently considers it both <em>Pesach Sheni</em> and <em>BeHaB</em>.
* As seen in an Ohr Sameach article on the subject <a href="https://ohr.edu/this_week/insights_into_halacha/9340">The
Expand Down Expand Up @@ -1416,7 +1416,7 @@ public int getTekufasTishreiElapsedDays() {
@Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
public boolean isVeseinTalUmatarStartDate() {
if (inIsrael) {
// The 7th Cheshvan can't occur on Shabbos, so always return true for 7 Cheshvan
// The 7th Marcheshvan can't occur on Shabbos, so always return true for 7 Marcheshvan
return getJewishMonth() == CHESHVAN && getJewishDayOfMonth() == 7;
} else {
if (getDayOfWeek() == Calendar.SATURDAY) { //Not recited on Friday night
Expand Down Expand Up @@ -1450,7 +1450,7 @@ public boolean isVeseinTalUmatarStartDate() {
@Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
public boolean isVeseinTalUmatarStartingTonight() {
if (inIsrael) {
// The 7th Cheshvan can't occur on Shabbos, so always return true for 6 Cheshvan
// The 7th Marcheshvan can't occur on Shabbos, so always return true for 6 Marcheshvan
return getJewishMonth() == CHESHVAN && getJewishDayOfMonth() == 6;
} else {
if (getDayOfWeek() == Calendar.FRIDAY) { //Not recited on Friday night
Expand Down
54 changes: 27 additions & 27 deletions src/main/java/com/kosherjava/zmanim/hebrewcalendar/JewishDate.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public class JewishDate implements Comparable<JewishDate>, Cloneable {
public static final int TISHREI = 7;

/**
* Value of the month field indicating Cheshvan/marcheshvan, the eighth numeric month of the year in the Jewish
* Value of the month field indicating Marcheshvan/marcheshvan, the eighth numeric month of the year in the Jewish
* calendar. With the year starting at {@link #TISHREI}, it would actually be the 2nd month of the year.
*/
public static final int CHESHVAN = 8;
Expand Down Expand Up @@ -166,23 +166,23 @@ public class JewishDate implements Comparable<JewishDate>, Cloneable {
/**
* A short year where both {@link #CHESHVAN} and {@link #KISLEV} are 29 days.
*
* @see #getCheshvanKislevKviah()
* @see #getMarcheshvanKislevKviah()
* @see HebrewDateFormatter#getFormattedKviah(int)
*/
public static final int CHASERIM = 0;

/**
* An ordered year where {@link #CHESHVAN} is 29 days and {@link #KISLEV} is 30 days.
*
* @see #getCheshvanKislevKviah()
* @see #getMarcheshvanKislevKviah()
* @see HebrewDateFormatter#getFormattedKviah(int)
*/
public static final int KESIDRAN = 1;

/**
* A long year where both {@link #CHESHVAN} and {@link #KISLEV} are 30 days.
*
* @see #getCheshvanKislevKviah()
* @see #getMarcheshvanKislevKviah()
* @see HebrewDateFormatter#getFormattedKviah(int)
*/
public static final int SHELAIMIM = 2;
Expand Down Expand Up @@ -689,7 +689,7 @@ private static void validateGregorianYear(int year) {
* @param year
* the Jewish year
* @return the number of days for a given Jewish year.
* @see #isCheshvanLong()
* @see #isMarcheshvanLong()
* @see #isKislevShort()
*/
public static int getDaysInJewishYear(int year) {
Expand All @@ -700,7 +700,7 @@ public static int getDaysInJewishYear(int year) {
* Returns the number of days for the current year that the calendar is set to.
*
* @return the number of days for the Object's current Jewish year.
* @see #isCheshvanLong()
* @see #isMarcheshvanLong()
* @see #isKislevShort()
* @see #isJewishLeapYear()
*/
Expand All @@ -709,28 +709,28 @@ public int getDaysInJewishYear() {
}

/**
* Returns if Cheshvan is long in a given Jewish year. The method name isLong is done since in a Kesidran (ordered)
* year Cheshvan is short. ND+ER
* Returns if Marcheshvan is long in a given Jewish year. The method name isLong is done since in a Kesidran (ordered)
* year Marcheshvan is short. ND+ER
*
* @param year
* the year
* @return true if Cheshvan is long in Jewish year.
* @see #isCheshvanLong()
* @see #getCheshvanKislevKviah()
* @return true if Marcheshvan is long in Jewish year.
* @see #isMarcheshvanLong()
* @see #getMarcheshvanKislevKviah()
*/
private static boolean isCheshvanLong(int year) {
private static boolean isMarcheshvanLong(int year) {
return getDaysInJewishYear(year) % 10 == 5;
}

/**
* Returns if Cheshvan is long (30 days VS 29 days) for the current year that the calendar is set to. The method
* name isLong is done since in a Kesidran (ordered) year Cheshvan is short.
* Returns if Marcheshvan is long (30 days VS 29 days) for the current year that the calendar is set to. The method
* name isLong is done since in a Kesidran (ordered) year Marcheshvan is short.
*
* @return true if Cheshvan is long for the current year that the calendar is set to
* @see #isCheshvanLong()
* @return true if Marcheshvan is long for the current year that the calendar is set to
* @see #isMarcheshvanLong()
*/
public boolean isCheshvanLong() {
return isCheshvanLong(getJewishYear());
public boolean isMarcheshvanLong() {
return isMarcheshvanLong(getJewishYear());
}

/**
Expand All @@ -741,7 +741,7 @@ public boolean isCheshvanLong() {
* the Jewish year
* @return true if Kislev is short for the given Jewish year.
* @see #isKislevShort()
* @see #getCheshvanKislevKviah()
* @see #getMarcheshvanKislevKviah()
*/
private static boolean isKislevShort(int year) {
return getDaysInJewishYear(year) % 10 == 3;
Expand All @@ -758,19 +758,19 @@ public boolean isKislevShort() {
}

/**
* Returns the Cheshvan and Kislev kviah (whether a Jewish year is short, regular or long). It will return
* {@link #SHELAIMIM} if both cheshvan and kislev are 30 days, {@link #KESIDRAN} if Cheshvan is 29 days and Kislev
* Returns the Marcheshvan and Kislev kviah (whether a Jewish year is short, regular or long). It will return
* {@link #SHELAIMIM} if both cheshvan and kislev are 30 days, {@link #KESIDRAN} if Marcheshvan is 29 days and Kislev
* is 30 days and {@link #CHASERIM} if both are 29 days.
*
* @return {@link #SHELAIMIM} if both cheshvan and kislev are 30 days, {@link #KESIDRAN} if Cheshvan is 29 days and
* @return {@link #SHELAIMIM} if both cheshvan and kislev are 30 days, {@link #KESIDRAN} if Marcheshvan is 29 days and
* Kislev is 30 days and {@link #CHASERIM} if both are 29 days.
* @see #isCheshvanLong()
* @see #isMarcheshvanLong()
* @see #isKislevShort()
*/
public int getCheshvanKislevKviah() {
if (isCheshvanLong() && !isKislevShort()) {
public int getMarcheshvanKislevKviah() {
if (isMarcheshvanLong() && !isKislevShort()) {
return SHELAIMIM;
} else if (!isCheshvanLong() && isKislevShort()) {
} else if (!isMarcheshvanLong() && isKislevShort()) {
return CHASERIM;
} else {
return KESIDRAN;
Expand All @@ -787,7 +787,7 @@ public int getCheshvanKislevKviah() {
* @return the number of days for a given Jewish month
*/
private static int getDaysInJewishMonth(int month, int year) {
if ((month == IYAR) || (month == TAMMUZ) || (month == ELUL) || ((month == CHESHVAN) && !(isCheshvanLong(year)))
if ((month == IYAR) || (month == TAMMUZ) || (month == ELUL) || ((month == CHESHVAN) && !(isMarcheshvanLong(year)))
|| ((month == KISLEV) && isKislevShort(year)) || (month == TEVES)
|| ((month == ADAR) && !(isJewishLeapYear(year))) || (month == ADAR_II)) {
return 29;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public boolean isTachanunRecitedMincha(JewishCalendar jewishCalendar) {
*/
public boolean isVeseinTalUmatarStartDate(JewishCalendar jewishCalendar) {
if (jewishCalendar.getInIsrael()) {
// The 7th Cheshvan can't occur on Shabbos, so always return true for 7 Cheshvan
// The 7th Marcheshvan can't occur on Shabbos, so always return true for 7 Marcheshvan
return jewishCalendar.getJewishMonth() == JewishDate.CHESHVAN && jewishCalendar.getJewishDayOfMonth() == 7;
} else {
if (jewishCalendar.getDayOfWeek() == Calendar.SATURDAY) { //Not recited on Friday night
Expand Down Expand Up @@ -275,7 +275,7 @@ public boolean isVeseinTalUmatarStartDate(JewishCalendar jewishCalendar) {
*/
public boolean isVeseinTalUmatarStartingTonight(JewishCalendar jewishCalendar) {
if (jewishCalendar.getInIsrael()) {
// The 7th Cheshvan can't occur on Shabbos, so always return true for 6 Cheshvan
// The 7th Marcheshvan can't occur on Shabbos, so always return true for 6 Marcheshvan
return jewishCalendar.getJewishMonth() == JewishDate.CHESHVAN && jewishCalendar.getJewishDayOfMonth() == 6;
} else {
if (jewishCalendar.getDayOfWeek() == Calendar.FRIDAY) { //Not recited on Friday night
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private void assertHaser(int year) {
JewishDate jewishDate = new JewishDate();
jewishDate.setJewishYear(year);

Assert.assertFalse(jewishDate.isCheshvanLong());
Assert.assertFalse(jewishDate.isMarcheshvanLong());
Assert.assertTrue(jewishDate.isKislevShort());
}

Expand All @@ -80,7 +80,7 @@ private void assertQesidrah(int year) {
JewishDate jewishDate = new JewishDate();
jewishDate.setJewishYear(year);

Assert.assertFalse(jewishDate.isCheshvanLong( ));
Assert.assertFalse(jewishDate.isMarcheshvanLong( ));
Assert.assertFalse(jewishDate.isKislevShort( ));
}

Expand All @@ -98,7 +98,7 @@ private void assertShalem(int year) {
JewishDate jewishDate = new JewishDate();
jewishDate.setJewishYear(year);

Assert.assertTrue(jewishDate.isCheshvanLong( ));
Assert.assertTrue(jewishDate.isMarcheshvanLong( ));
Assert.assertFalse(jewishDate.isKislevShort( ));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<html>
<body>
In writing these unit tests, I found http://www.printablejewishcalendar.com/ which produces a nice output
for each month. And, given that Cheshvan, Kislev and Adar are the only variable months, it was fairly easy
for each month. And, given that Marcheshvan, Kislev and Adar are the only variable months, it was fairly easy
to work out the following:

<pre>
Year Cheshvan Kislev LEAP? TYPE
Year Marcheshvan Kislev LEAP? TYPE
5769 29 30 No Qesidrah
5770 30 30 No Shalem
5771 30 30 Yes Shalem Leap
Expand Down Expand Up @@ -50,7 +50,7 @@
<li>Av</li>
<li>Elul</li>
<li>Tishri</li>
<li>Cheshvan</li>
<li>Marcheshvan</li>
<li>Kislev</li>
<li>Tevet</li>
<li>Shevat</li>
Expand Down