19 June 2008

Religious Calendar Script

If you would like to have a JavaScript application to show the current day, date, holiday, prayer times, and prayer orientation (e.g., direction and distance to Mecca or Jerusalem) for the Hebrew, Christian (Western, Eastern, or Coptic), Islamic, or Bahai faiths, you can save a copy of the one I wrote for dogchurch.org. Just click here, and use the "Save As" capability of your browser to save a copy to your local desktop. You can use and modify the file under the GNU Public License. If you use the script or a modified form of it, you must acknowledge The Virtual Church of the Blind Chihuahua or dogchurch.org.

No documentation is provided (other than the code itself - and you must know JavaScript to read it), and you use the file at your own risk. We do not assume any responsibility or liability for the correctness of the calculations. In fact, since the Hebrew and Islamic calendars are observational, not calculated, the above referenced script is only an approximation (but based on very good algorithms from Calendrical Calculations by Reingold and Dershowitz, as well as astronomical code from the US National Oceanic and Atmospheric Administration). Rather than ask the user for his or her location, the script uses GeoIP services from MaxMind.com to estimate the latitude and longitude of the user, based on the user's IP address.

At the end of the script are two functions Salutation and Liturgical Salutation that you can call from your HTML to display the calendar information on your page. Examples of the script in action are

VCBC's Former Home Page
VCBC - Christianity
VCBC - Baha'i
VCBC - Islam
VCBC - Judaism

Contact us with errata, suggestions, or questions.

No comments: