GithubHelp home page GithubHelp logo

hebcal / hebcal-js Goto Github PK

View Code? Open in Web Editor NEW
123.0 123.0 40.0 2.01 MB

⛔️ DEPRECATED - a perpetual Jewish Calendar (JavaScript)

License: GNU General Public License v3.0

JavaScript 96.86% HTML 3.14%
deprecated no-maintenance-intended obsolete

hebcal-js's Introduction

hebcal Build Status

A perpetual Jewish Calendar

by Danny Sadinoff (portions by Michael J. Radwin)

Description

Hebcal is a program which prints out the days in the Jewish calendar for a given Gregorian year. Hebcal is fairly flexible in terms of which events in the Jewish calendar it displays. Each of the following can be individualy turned on or off:

  • The Hebrew date
  • Jewish Holidays (including Yom Ha'atzmaut and Yom HaShoah etc.)
  • The weekly Sedrah
  • The day of the week
  • The days of the Omer

Synopsis

usage: hebcal [options] [[ month [ day ]] year | YYYY-MM-DD ]
       hebcal help
       hebcal info
       hebcal cities
       hebcal warranty
       hebcal copying

Hebcal prints out Hebrew calendars one solar year at a time. By specifying month, day, or year, output can be limited to a particular month or date in a particular year.

Note that year is usually a four-digit integer, so 92 is during the Roman period, not the late twentieth century. If the Hebrew dates option (-H) is turned on, this number represents the Jewish calendar year.

month is a number from 1..12, or the name of a Jewish calendar month. day is a number from 1..31.

A single day may also be specified as YYYY-MM-DD (ISO 8601 date format).

For example, the command hebcal 10 1992 will print out the holidays occurring in October of 1992 C.E., while the command hebcal Tish 5752 will print dates of interest in the month of Tishrei in Jewish calendar year 5752.

If no year is specified, hebcal will print to stdout the dates of the Jewish holidays in the current secular year.

For example, hebcal -ho will just print out the days of the omer for the current year.

Options

General options

Option Description
--help Show help text
--version Show version number

Input Options

Option Description
-H, --hebrew-date Use Hebrew date ranges - only needed when e.g. hebcal -H 5373
-I, --infile INFILE Get non-yahrtzeit Hebrew user events from specified file. The format is: mmm dd string, Where mmm is a Hebrew month name.
-t, --today Only output for today's date
-T, --today-brief Print today's pertinent information, no Gregorian date.
-X, --exit-if-chag Exit silently with non-zero status if today is Shabbat or Chag; exit with 0 status if today is chol.
-Y, --yahrtzeit YAHRTZEIT Get yahrtzeit dates from specified file. The format is: mm dd yyyy string. The first three fields specify a Gregorian date.

Output Options

Option Description
-8 Use UTF-8 Hebrew (alias for --lang=he).
-a, --ashkenazi Use Ashkenazi Hebrew transliterations (alias for --lang=ashkenazi).
--chag-only Output only Chag and Erev Chag events (when melakha/labor is prohibited)
-d, --add-hebrew-dates print the Hebrew date for the entire date range.
-D, --add-hebrew-dates-for-events print the Hebrew date for dates with some events
-e, --euro-dates Output "European" dates -- DD.MM.YYYY format.
-E, --24hour Output 24-hour times (e.g. 18:37 instead of 6:37).
-F, --daf-yomi Output the Daf Yomi (Bavli) for the entire date range.
-g, --iso-8601 Output ISO 8601 dates -- YYYY-MM-DD (this overrides -y)
-h, --no-holidays Suppress default holidays.
-i, --israeli Use Israeli holiday and sedra schedule.
--lang LANG Use ISO 639-1 LANG code (one of ashkenazi, ashkenazi_litvish, ashkenazi_poylish, ashkenazi_romanian, ashkenazi_standard, de, es, fi, fr, he, hu, pl, ro, ru, uk)
--mevarchim Include Shabbat Mevarchim HaChodesh.
--mishna-yomi Output the Mishna Yomi for the entire date range.
-M, --molad Print the molad on shabbat mevorchim.
--nach-yomi Output the Nach Yomi for the entire date range.
--no-mf Suppress minor fast days.
--no-modern Suppress modern Israeli holidays.
--no-special Suppress Special Shabbatot.
-o, --omer Add days of the omer.
-O, --sunrise-and-sunset Output sunrise and sunset times every day.
-r, --tabs Tab delineated format.
-s, --sedrot Add weekly sedrot on Saturday.
--schottenstein Use Schottenstein edition of Yerushalmi Yomi
-S, --daily-sedra Print sedrah of the week on all calendar days.
--verbose Verbose mode, currently used only for --exit-if-chag
-w, --weekday Add day of the week.
-W, --abbreviated Weekly view. Omer, dafyomi, and non-date-specific zemanim are shown once a week, on the day which corresponds to the first day in the range.
-x, --no-rosh-chodesh Suppress Rosh Chodesh.
-y, --year-abbrev Print only last two digits of year.
--years N Generate events for N years (default 1)
--yerushalmi Output the Yerushalmi Yomi for the entire date range.
--ykk Include Yom Kippur Katan, minor day of atonement occurring monthly on the day preceding each Rosh Chodesh

Options related to candle-lighting times

Option Description
-b, --candle-mins mins Set candle-lighting to occur this many minutes before sundown. Default 18 if unspecified (default 40 for Jerusalem, 30 for Haifa, 30 for Zichron Ya'akov).
-c, --candlelighting Print candlelighting times.
-C, --city city Set latitude, longitude, and timezone according to specified city. This option implies the -c option.
--geo LATITUDE,LONGITUDE Set location for solar calculations to decimal values LATITUDE and LONGITUDE. Negative longitudes are WEST of the Prime Meridian.
-G, --havdalah-deg DEGREES Set Havdalah to occur this many degrees below the horizon
-l, --latitude XX,YY Set the latitude for solar calculations to XX degrees and YY minutes. Negative values are south. Deprecated: use --geo instead.
-L, --longitude XX,YY Set the longitude for solar calculations to XX degrees and YY minutes. Negative values are EAST. The -l and -L switches must both be used, or not at all. These switches override the -C (localize to city) switch. Deprecated: use --geo instead.
-m, --havdalah-mins MINS Set havdalah to occur this many minutes after sundown
-z, --timezone timezone Use specified timezone, overriding the -C (localize to city) switch. For correct DST rules, use a full timezone name (such as America/New_York) instead of a timezone abbreviation (such as EST)
-Z, --zmanim Add zemanim (Alot HaShachar; Misheyakir; Kriat Shema, sof zeman; Tefilah, sof zeman; Chatzot hayom; Mincha Gedolah; Mincha Ketanah; Plag HaMincha; Tzait HaKochavim)

Candle-lighting and fast start/end times

Hebcal’s candlelighting times are only approximations. If you ever have any doubts about its times, consult your local halachic authority. If you enter geographic coordinates above the arctic circle or antarctic circle, the times are guaranteed to be wrong.

In addition to candle-lighting on Erev Shabbat and Chag, the -c switch also generates Havdalah and fast start/end times.

By default, candle-lighting times are 18 minutes before sunset (see -b option above for exceptions).

Chanukah candle-lighting times are at bein hashmashos (13.5 minutes before a solar depression of 7.083 degrees) on weekdays. Chanukah candles are lit just before Shabbat candles on Friday, and immediately after Havdalah on Saturday night.

Havdalah time defaults to 72 minutes after sunset (Rabbeinu Tam). Adjust with the -m (minutes) option or with -G (havdalah degrees below horizon).

Minor fasts begin in the morning at alot haShachar (solar depression 16.1 degrees) and conclude at tzeit for 3 medium sized stars (solar depression 7.083 degrees). Major fasts (Yom Kippur and Tish'a B'Av) begin just before sunset (at regular candle-lighting time) and conclude at Havdalah time.

Hebcal contains a small database of cities with their associated geographic information and time-zone information. Run hebcal cities to print a list of cities supported by the -C city flag.

If your city is NOT on the list, then in order to customize hebcal to your city, you will need to pass it the latitude, longitude, and timezone (see the manual).

Suppose you live in Oshkosh, Wisconsin. Your latitude is 44.0181, and your longitude is -88.6353. You are in timezone America/Chicago. We'll round the geographic coordinates to the nearest minute.

In order to get candlelighting times for the current year, you would type

hebcal -ch --geo 44.0181,-88.6353 -z America/Chicago

The geographic and time information necessary to calculate sundown times can come to hebcal any of three ways:

  1. The default: the system manager sets a default city ("New York") when the program is compiled.
  2. Hebcal looks in the environment variable HEBCAL_CITY for the name of a city in hebcal’s database, and if it finds one, hebcal will make that the new default city.
  3. 1 and 2 may be overridden by command line arguments, including those specified in the HEBCAL_OPTS environment variable. The most natural way to do this is to use the −C city command. This will localize hebcal to city. A list of the cities hebcal knows about can be obtained by typing hebcal cities at the command prompt. If the city you want isn’t on that list, you can directly control hebcal’s geographic information with the --geo (or −l and −L) and −z switches.

For a status report on customizations, type hebcal info at the command prompt.

Environment

Hebcal uses two environment variables:

HEBCAL_CITY
Hebcal uses this value as the default city for sunset calculations. A list of available cities is available with from hebcal with the command: hebcal cities
HEBCAL_OPTS
The value of this variable is automatically processed as if it were typed at the command line before any other actual command-line arguments.

HEBCAL_OPTS

Every time hebcal is run, it checks this variable. If it is non-empty, the arguments in that variable are read as though they were typed at the command line before the ones you actually type.

So you might set HEBCAL_OPTS to be

--geo 44.0181,-88.6353 -z America/Chicago

and if you type hebcal -ch hebcal will think you typed hebcal --geo 44.0181,-88.6353 -z America/Chicago -ch

For information on setting environment variables, consult your local guru.

Author

Danny Sadinoff

With contributions from

  • Michael J. Radwin
  • Eyal Schachter (JavaScript port)
  • Aaron Peromsik (Daf Yomi, experimental zmanim feature)
  • Ben Sandler (Molad and daily Sunrise/Sunset features)

See Also

calendar(1), emacs(1), hcal(1), hdate(1), omer(1), remind(1), rise(1)

The latest version of the code will be available from https://github.com/hebcal/hebcal

The original motivation for the algorithms in this program was the Tur Shulchan Aruch.

For version 3, much of the program was rewritten using Emacs 19’s calendar routines by Edward M. Reingold and Nachum Dershowitz. Their program is extremely clear and provides many instructive examples of fine calendar code in emacs-LISP.

For version 4, candle-lighting times were rewritting using Derick Rethans's timelib.

Version 5 was ported from C to Go.

A well written treatment of the Jewish calendar for the layman can be found in Understanding the Jewish Calendar by Rabbi Nathan Bushwick. A more complete bibliography on the topic can be found there, as well as in the Encyclopedia Judaica entry on the calendar.

Diagnostics

hebcal help
Prints a shorter version of this manpage, with comments on each option.
hebcal info
Prints the version number and default values of the program.
hebcal cities
Prints a list of cities which hebcal knows about, suitable as arguments to the −C city option.
hebcal copying
Prints the GNU license, with information about copying the program. See below.
hebcal warranty
Tells you how there’s NO WARRANTY for hebcal.

Disclaimer

This is just a program I wrote during summer school and while avoiding my senior project. It should not be invested with any sort of halachic authority.

Bugs

Hebrew dates are only valid before sundown on that secular date. An option to control this will be added in a later release.

When using the legacy -L flag, negative longitudes are EAST of Greenwich.

Some combinations of options produce weird results, e.g. hebcal -dH nisan 5744 hebcal -dH 5744 This comes into play when you use the HEBCAL_OPTS environment variable.

The sunup/sundown routines aren’t accurate enough. If you enter geographic coordinates above the arctic circle or antarctic circle, the times are guaranteed to be wrong.

Hebcal only translates between the Gregorian calendar and the Jewish calendar. It does not take into account a correction of eleven days that was introduced by Pope Gregory XIII known as the Gregorian Reformation. Wednesday, 2 September 1752 was followed by Thursday, 14 September 1752.

This means that the results will be at least partly useless where and when the Gregorian calendar was not used, e.g. before the 1752 in Britain and before circa 1918 in Russia. See "Gregorian calendar" on Wikipedia for a splendid chart depicting when the changeover from the Julian to the Gregorian calendars occurred in various places.

Build & Install

To build hebcal from the source repository, you'll need the following:

  • Go version 1.13 or higher
  • GNU make v3.79 or later

Once you have those, you can prepare the build environment as follows:

make clean all

DISTRIBUTION

Copyright (C) 1994-2011 Danny Sadinoff

Portions Copyright (c) 2011-2022 Michael J. Radwin. All Rights Reserved.

Hebcal is distributed under the GNU Public License. The program and its source code may be freely distributed. For details, see the file COPYING in the distribution.

If you are going to use this program, please drop me a line. I'd like to know who you are, what version you're using, and how you're using hebcal, and anything else you'd like to tell me, so that I can adjust the program to meet users' needs.

I am NOT demanding payment for the use of my program, but writing this program DID take time. The "free" in the GNU public license refers to distribution, not necessarily payment. Feel free to send $10 or multiples of $18 or just a postcard to me at my US Mail address (email me for it).

  send email to:
  [email protected]

hebcal-js's People

Contributors

asafbe avatar avrahituv avatar dredozubov avatar dsadinoff avatar gnudles avatar haimkastner avatar icarpis avatar ilyagelman avatar kalmanh avatar mjradwin avatar scimonster avatar shuki770 avatar ybudweiser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hebcal-js's Issues

There is a problem in the parasha name after pesakh

There is a problem in the parashot names after pesakh.
For example: It should be "אחרי מות" but it's write "פסח". - two weeks it's write "פסח".
I check it by change the date of my computer to 23/04/2019.

Thanks,
Doron

Name of CLI

For v2.1, i added a small CLI script to print data. It's really not compatible with the regular Hebcal, so i don't want to call it hebcal. What should i call it? Right now i have hebcaljs, but does that make it sound like it's for doing something with JavaScript?

I'm not sure that the GPL means what you think it does.

Hey,

I've ported KosherJava to Objective-C so I'm happy to see a similar library available in Javascript. I'm just not sure that you're reading the GPL correctly.

Remember, the GPL means you can't use this in a closed-source program!

According to GitHub's ChooseALicense.com, the GPL only requires that closed source programs disclose the source of the library covered by the GPL.

If you specifically don't want to allow people to use hebcal-js in a closed source app, that's your decision, but you might be running into a GPL issue yourself.

Great work!

Tutorials

It may be a good idea to make video tutorials for this great library.

Hebcal.events.customs exsample

Hi,

Thanks for this library a lot of work was put into it.

Can you please show me an example for how to trigger a custom event at a specific time?

Thank's a lot

Avi

getZemanim is returning values for previous day

I have the following code:
var hdate = Hebcal.HDate().setLocation(31.783, 35.233);
console.log(hdate.sunrise());

It gives me Mon May 02 2016 05:53:36 GMT+0300 (שעון קיץ ירושלים) which is in fact yesterday.

To support my argument that it is yesterday, I can run new Date();
and it gives me Tue May 03 2016 16:35:05 GMT+0300 (שעון קיץ ירושלים)

It does,however, give me the correct Hebrew date for today, Tue May 3:
HDate {month: 1, day: 25, year: 5776, lat: 31.783, long: 35.233…}

Anyone can explain to me what I am missing? Is this a bug?

Google Apps Script

Please forgive my ignorance -- I'm familiar with programming in general, but know very little about JS.

I'm trying to create a function in Google Sheets that will convert Hebrew and Gregorian dates using this library.
I imported the client side script into Google Apps Script and created a function, but quickly realized that scripts meant for a browser will not play well in GAS (e.g. window, setInterval, etc.), which runs the script on Google's servers (I think).

I get the feeling I'm going about this the wrong way - should I be using the Node version? I'm a little lost on how that works...

If anyone is able to help, I'd greatly appreciate it.
Thanks!

Display proper Hebrew year without ה

Hi,
the following basic script will load the current date but with diacritics

<script type="text/javascript" charset="utf-8" src="http://hebcal.com/etc/hdate-he.js">var hebdate Hebcal.HDate(); console.log(hebdate);</script>

This displays: י״ב בְּתַמּוּז תשע״ו

Is there a way it can be called and displayed without the diacritics?

Thanks

apostrophe instead of geresh in numbers

In hebrew numerals, apostrophe is used instead of geresh (U+05F3). While they look similar, they behave different when it comes to bidi-handling. If you embed a hebrew date in a latin (ltr) context and it ends with an apostrophe, the apostrophe will jump from the left to the right of the date. (This would happen if you print a date w/o year for the months adar i and adar ii).

I assume quotes are used instead of gershayim, but it does not have the same implications.

.candleLighting() is returning 'thursday' for a 'erev shabbat'

I am using New York as the city. Shabbat candelighting should be on a friday rather than thursday. Here is a sample shabbat, this may be affecting other holidays and calculations as well:

var hebcal = new Hebcal();
var holidays = hebcal.holidays;
var holiday1 = holidays[19]; <--- returns erev shabbat
var whencandle = holiday1.candleLighting(); <--- returns a thursday date

hope this makes sense, hope its a good find.
Thanks!

Find good cities database

Requirements for a city DB:

  • Must work in both Node and browser
  • Must recognize Israel's borders (this throws out pretty much everything :()

Fix default Adar

In the C code, a plain 'Adar' defaults to Adar Sheini. In the JS, it defaults to Rishon. The C checks if Adar2 was given during a non-leap year, and fixes to 1.

I think it's more useful to default to the second, as that's when Purim is.

`HDate.setTishreiMonth(13)` should wrap the year

HDate.setTishreiMonth(13) should advance to Tishrei of the next year. For example:

var hd = new Hebcal.HDate('15 Nisan 5775');
console.log(hd.getTishreiMonth()); // 7
hd.setTishreiMonth(13);
console.log(hd.toString()); // 15 Tishrei 5775

It should log 15 Tishrei 5776.

Wrong gregorian date prior to greg. year 1

Hello,

var hdate = new Hebcal.HDate(18, 10, 3761);
hdate.greg() => Mon Jan 01 0001 00:00:00 GMT+0220

And whenever we go under that, it's completely broken. The day before :

var hdate = new Hebcal.HDate(17, 10, 3761);
hdate.greg() => Thu Dec 31 -504 00:00:00 GMT+0220

500 years before :

var hdate = new Hebcal.HDate(17, 10, 3261);
Tue Jan 03 -1003 00:00:00 GMT+0220

And one more day before :

var hdate = new Hebcal.HDate(16, 10, 3261);
hdate.greg() => Tue Jan 01 -899 00:00:00 GMT+0220

That's a very big issue for me !

What exactly is a standard options string?

Firstly, great thanks for this amazing plugin. Using it for a Torah-inspired project.

I'm using it on Node.js and it's been a good experience so far.

The word options appears 6 times in the documentation, specifically referring to a standard options string. What exactly does the documentation mean by a standard options string?

Daf Yomi: Hebcal reports Midot 34 as Tamid 34

I think I may have found a bug in the naming of a particular daf in the daf yomi calculations.

Current Result

The following yields Tamid 34:

new Hebcal.HDate(new Date('2019-10-21 00:00:00')).dafyomi('h')

...as can be seen in this screenshot:

image

Expected

However, folio number 34 is actually the first daf of Midot, not the last of Tamid. Here's a link to that folio: http://hebrewbooks.org/pdfpager.aspx?req=37968&st=&pgnum=850

Looking at the daf yomi calendar, we can also see that they've labeled it as Midot:

image

I think the bug is here:

hebcal-js/src/dafyomi.js

Lines 120 to 132 in fcf7cbb

switch (count) {
case 36:
blatt = blatt + 21;
break;
case 37:
blatt = blatt + 24;
break;
case 38:
blatt = blatt + 33;
break;
default:
break;
}

Molad for Shabbat Mevarchim

Hebcal.Month() should have a molad() method, returning an object such as {day: 3, hours: 8, chalakim: 24, date: new Date()} (random values there).

findSedra should work better

var year = new Hebcal(5775); // define the year

year.findSedra('Miketz') // good
year.findSedra('miketz') // not found
year.findSedra('מקץ') // not found
year.findSedra('מקצ','h') // not found
year.findParsha('Shemos','a') // good
year.findParsha('Shemos') // nope

Expected behavior: Find the parsha regardless of spelling.

Sunrise and sunset are not exact

Thank you very much, but i find a bug..

You use the suncalc library to calculate sunrise and sunset times.
but times are not accurate, for example:
today, 30-08-2018 the sunrise is: 06:13 in jerusalem as can be seen on the site yeshiva.org.il.
sunris-yeshiva-site
but the library tells me that time is 06:25..
sunrisejson

i see the suncalc calculate the sunrise like this:
var times = SunCalc.times = [ [-0.833, 'sunrise', 'sunset' ], [ -0.3, 'sunriseEnd', 'sunsetStart' ], [ -6, 'dawn', 'dusk' ], [ -12, 'nauticalDawn', 'nauticalDusk'], [ -18, 'nightEnd', 'night' ], [ 6, 'goldenHourEnd', 'goldenHour' ] ];
and in order for me to get the right times, I have to run over the sunrise to -2.4
the same is true of sunset..

Who can help me??
Thanks!

setCity() doesn't work

I'm trying to get the Jerusalem candle lighting time for the coming Shabat by the following code snippet:

var hebDate = new Hebcal.HDate();
hebDate.setCity('Jerusalem');
var d = hebDate.after(5).candleLighting();

For some reason I'm getting the same time no matter if I call to setCity or not.

I don't get how tachanun works

Hi

A great library, thanks! I didn't understand how Tachanun works, it seems that it returns different integers than described, or I'm calling it wrong

When I'm trying to get Tachanun for 4th of Tishri, it returns 7, the same is with 8th, but 9th returns 0. Also, Yom Haatzmaut returns 3

Can you please explain how to use this function? Thanks

No molad-date for Tishrei

The molad is determined using shabbat_mevarchim (hebcal.js line 495) and Elul has no shabbat_mevarchim (hebcal.js line 537).

This will blow up:
this.prev().find('shabbat_mevarchim')[0].onOrAfter(retMolad.doy).greg();

Paris location

I have just tried to play with the exemple.html and i noticed that Paris longitude and latitude should be swapped.

Molad for Shabbat Mevarchim

Hebcal.Month() should have a molad() method, returning an object such as {day: 3, hours: 8, chalakim: 24, date: new Date()} (random values there).

setLocation affect nothing

Im runnig the following code locally(ISRAEL) and in my server (PARIS) - and i got different zmanim for the same date & location

const today = new Hebcal.HDate().setLocation(lat, lng);
console.log(today.getZemanim());

Fetch next Torah Portion?

Hi! Thanks for providing this API. We're wondering what the best way is to query the API and get the next Torah portion. We can query by month but if the next Shabbat is in the following month, then the response doesn't have what we need. Is there a param to pass to request only the next Torah portion? Here's the API call we're currently experimenting with:

http://www.hebcal.com/hebcal/?v=1&year=now&s=on&month={month}&cfg=json&geo=zip&zip={zip}

Thank you for any help with this!
Matt

Just wanna say thanks :)

Hey -- I have started using hebcal-js with in a React project, and it works perfectly - so thanks a lot for that ❤️

(it is still a secret project so I can't share yet - will share soom)

HDate.prototype.next and HDate.prototype.prev don't copy lat and long properties

Main problem is in computing candleLighting

Event.prototype.candleLighting = function() {
    var date = this.date.next();
    if (this.LIGHT_CANDLES) {
        return new Date(date.sunset() - (Event.candleLighting * 60 * 1000));
    } else if (this.LIGHT_CANDLES_TZEIS) {
        return date.getZemanim().tzeit;
    }
    return null;
};

date has lat and long equals 0; and computing executes independs of locations

Hebcal hangs indefinitely?

I don't know if I'm doing something wrong here... but the npm module seems to hang after requiring the module.

Can you reproduce this behavior with my 1-liner?

MTVL10d09b0d4:~ mradwin$ cat hebcal-require.js 
var Hebcal = require('hebcal');
MTVL10d09b0d4:~ mradwin$ node --version
v0.10.21
MTVL10d09b0d4:~ mradwin$ npm ls hebcal
/Users/mradwin
└── [email protected] 

MTVL10d09b0d4:~ mradwin$ node hebcal-require.js 
^C
MTVL10d09b0d4:~ mradwin$ 

TypeError: invalid pid after each hebcaljs command

Hi,
I just installed hebcal thru npm global on a mac and I always get the following error after the hebcaljs command e.g.
$ hebcaljs -T
9 Iyyar 5776

Times:
Chatzot Mon May 16 2016 14:57:46 GMT+0300 (IDT)
Chatzot Night Mon May 16 2016 02:57:45 GMT+0300 (IDT)
Alot Hashachar Mon May 16 2016 07:49:28 GMT+0300 (IDT)
Misheyakir Mon May 16 2016 08:09:01 GMT+0300 (IDT)
Misheyakir Machmir Mon May 16 2016 08:14:32 GMT+0300 (IDT)
Sof Zman Shma Mon May 16 2016 11:56:00 GMT+0300 (IDT)
Sof Zman Tfilla Mon May 16 2016 12:56:36 GMT+0300 (IDT)
Mincha Gedola Mon May 16 2016 15:28:04 GMT+0300 (IDT)
Mincha Ketana Mon May 16 2016 18:29:50 GMT+0300 (IDT)
Plag Hamincha Mon May 16 2016 19:45:34 GMT+0300 (IDT)
Tzeit Mon May 16 2016 21:33:47 GMT+0300 (IDT)
Neitz Hachama Mon May 16 2016 08:54:14 GMT+0300 (IDT)
Shkiah Mon May 16 2016 21:01:18 GMT+0300 (IDT)
node.js:758
throw new TypeError('invalid pid');
^

TypeError: invalid pid
at process.kill (node.js:758:15)
at Object. (/Users/asher/.npm-packages/lib/node_modules/hebcal/bin/hebcal.js:218:9)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:136:18)
at node.js:963:3

It happens when you call process.kill(); at line 218 of hebcal.js

I hope there is a fix
Thanks
Asher

Wrong Gregorian Date for Molad

I haven't started extensive testing, but today (May 9th) is Rosh Chodesh Iyar day #2, and the library says that the english date for the molad is "Fri May 13 2016 22:59:56 GMT-0400 (EDT)", which I believe is exactly 1 week late.

Sample Code:
var year = new Hebcal;
var date = new Hebcal.HDate();
console.log(year.getMonth(date.getMonth()).molad());

FWIW, the date/time of the molad is Jerusalem Solar Time, and it would be really cool to convert it to local solar time, and then local standard time, for calculating things like earliest/latest time to say kiddush levana.

Why h[push]() instead of h.push()?

@Scimonster, a naive JavaScript question for you.

In holidays.js, why do you do this:

    var push = 'push';
    h[push](new Event(
            RH,
            ['Rosh Hashana 1', 0, 'ראש השנה א\''],
            LIGHT_CANDLES_TZEIS
    ));

Instead of

    h.push(new Event(
            RH,
            ['Rosh Hashana 1', 0, 'ראש השנה א\''],
            LIGHT_CANDLES_TZEIS
    ));

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.