HebrewDate Open Source Project

by Avrom Finkelstein

 
What is the HebrewDate Open Source Project?

The HebrewDate Open Source Project is a collection of classes which I originally wrote in C++ and later converted to Java to facilitate the writing of programs that will contain english/hebrew dates. This code, in turn is based on other public domain and open source code. The original purpose behind writing these classes (aside from the fact that it gave me something to do) was to create a Hebrew Date class in which I could generate web pages with a monthly calendar and the corresponding hebrew dates and jewish holidays. However, as per standard object oriented design (reusibility etc.) I have made the classes as generic as possible, so they may be used easily in any application.

What is your code based on?

My code is based on C++ code written by Nachum Dershowitz and Edward M. Reingold which they converted from Lisp code. The C++ code is available here. In addition, two other sources (who themselves used code by the above two) were used. Danny Sadinoff's hebcal, a well known hebrew calendar program for Unix and Windows written in C was used, and JCal (aka "Jewish Calendar"), a hebrew calendar program for the Mac, written by Frank Yellin.

The original techincal paper written by Nachum Dershowitz and Edward M. Reingold, Calendrical Calculations, is available in postscript format.

 
Why did you convert the code into Java?

Because I can.

Seriously, for the last while I have been programming in Java instead of C++ and I thought it would be an interesting project. Fortunately, since the hebrew date classes contain very little member data fields and C++ syntax is very similar to Java syntax, converting the code was very easy. Most of my effort went into changing indentifier names into a more Java convention. In other words, the Java classes are now Javabeans.

Converting the code to Java also had the added advantage that I could use the classes in Java specific technology, specficially, JSP, which is currently being used to dynamically generate the resulting web pages.

What is this candlelighting code for?

The candlelighting and havdala time code is a relatively recent addition to the Java API. Since most religious Jews want to know the time for lighting the Shabbos (Sabbath) candles and the havdala (close of the Sabbath) time along with what the hebrew date is, I thought it would be most appropriate to add it to the API.

The underlying code requires calculation of the sunset time for a given location. To that end, I am currently using code written by Kevin Boone. It is available from his website.

Where is the source code?

Here is the Java source code along with their Javadoc documentation. The latest version is as of September 2002.

Javadoc

Source code in a zip archive

Documentation in a zip archive

Classes in a jar file

Here is the original C++ class and header files along with their API documentation.

API documentation

hebdate.cpp Source code for the base class, HebDate.
hebdateh.cpp Source code for the derived class, HebDateH.
hebdate.h Header file for both classes.

main5.c Code used to generate a monthly calendar for the BAYT Calendar.