Giter Club home page Giter Club logo

hebcal-es6'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-es6's People

Contributors

dependabot[bot] avatar majortom64 avatar mendelk avatar mjradwin avatar nhw80697 avatar yizyah 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hebcal-es6's Issues

Error Method get Intl.DateTimeFormat.prototype.format called on incompatible receiver undefined, with Devexpress datagrid

Devepxress is very poplular datagrid system for Angular, React etc
Since hebcal >=5.0, there is an error
TypeError: Method get Intl.DateTimeFormat.prototype.format called on incompatible receiver undefined
after initlize hebcal

This is the error in the devtools console:
main.ts:11 ERROR TypeError: Method get Intl.DateTimeFormat.prototype.format called on incompatible receiver undefined
at get format ()
at format (index.mjs:2029:55285)
at formatDateTime (date.js:41:12)
at date.js:27:16
at Object.format (date.js:207:20)
at Object. (class.js:18:27)
at object. [as format] (dependency_injector.js:29:46)
at Object.format (format_helper.js:41:20)
at object. [as format] (dependency_injector.js:29:46)
at Object.formatValue (m_utils.js:121:21)

Below a link for very minimal example to see the error.
How to install the example:

  1. git clone https://github.com/aepshtin/test-hebcal-dx
  2. cd test-hebcal-dx
  3. npm i
  4. ng s

then open the browser at: http://localhost:4200/

and see the error in the console
Just comment out the Zman initilze and see how it works well

image

In version 4.5.1 it works well.
But i want to use version >=5.0 becuse of the elevation calculation.
Thanks a lot

HDate should collaborate with Nightfall

I'm not sure how to express my issue, will try my best.
Currently, HDate is calculated based on a Gregorian date, but the problem is that the gregorian date changes at midnight while the hebrew date changes at nightfall..
If i want to check a datetime for any event, i can't just rely on HDate since it will return results based on the gregorian date which won't change till midnight. so i also need to check if it's after nightfall and considered next hebrew date.
Is it possible to add the functionality of calculating the HDate based on the time and GeoLocation which should change at nightfall?
I hope this is clear enough.
Thanks!

new HDate with month 12 and day greater than 29 error

When an invalid date is passed to the constructor of HDate(), normally it is handled by calling fix(date), which will either increment or decrement the month to return a valid date. For example, new HDate(30, 2, 5784) will roll over and return HDate {month: 3, day: 1, year: 5784}.
This does not work for Adar in a non leap year, so a call to new HDate(30, 12, 5783) will not return HDate {month: 1, day: 1, year: 5783}
as I expected, rather HDate {month: 12, day: 1, year: 5783}.
This is because of this line of code increments the month to 13, and then this next function decrements it back to 12.
A fix for this would be to replace date.mm += 1; in here with

 if (date.month === months.ADAR_I && !date.isLeapYear()) {
      date.month = months.NISAN;
    }
    else date.month += 1;

I don't want to open a PR, because I was unable to test locally.

Uncaught TypeError when using package with Vite

Hello, I've been using your package for a React project that was based on the Create React App framework and have had no issue utilizing it. Since the framework is deprecated and has security issues, I need to migrate our project to Vite.

Unfortunately, I encountered the following error when attempting to run it:
image

Following the link mentioned in the warning above, I see that the issue is caused by a Node module, events, being used. Since Vite does not automatically apply polyfills, this error appears.

Though I could install the polyfill to fix this issue, I noticed that the Readme mentions this package is meant to be compatible with browsers, so I wanted to open this issue.

Hebrew string Date conversion to either Normal Hebrew date or Gregorian Date

const hd = new HDate(date.day, month, date.year);
return hd.renderGematriya(true);

by this two lines of code we can able to make the conversion of Hebrew date to Hebrew text date (כ״ד בְּתַמּוּז תשפ״ג). but we can't do Hebrew text date to hebrew date(24th of Tamuz, 5783) or Gregorian Date(Wed, 12 July 2023) using the library. i have checked whole documentation but not found anything solid which gives me the option to do the above mentioned task.

Is there a simple way to turn a Date object into the equivalent HDate?

Unless I am missing it, I cannot find a single step way to turn a JS Date into the HDate for the same day. Related question (maybe just needs documentation): What is the difference between: getBirthdayOrAnniversary(hyear, gdate) ⇒ HDate
and
getYahrzeit(hyear, gdate) ⇒ HDate ?

Candle lighting

This is more of a feature request. Is it possible to add the ability to get candle lighting for a HDate?

v 2.11.0

@mjradwin I used till now version 2.6.1, and it worked perfect.
I upgraded to latest version, and when I try to use new HDate(), I get the following error: "ERROR TypeError: hebcal_core__WEBPACK_IMPORTED_MODULE_1_.HDate is not a constructor"

Example how to exclude holiday types with `HebrewCalendar.getHolidaysOnDate`

HebrewCalendar.getHolidaysOnDate(date, false) returns an Event array if there are any events for the given date. How do I select what kind of events I want? For example, if I only want Chagim, how would I do it?

I see Hebcal has flags. However, .getHolidaysOnDate does not have an option to pass them in. I also see that Event has a mask field, which seems to identify the specific holiday. However, how can I figure out which category a holiday is a part of?

Weekday Torah Reading Leyning?

Via the API, is there a way to get the weekday Torah leyning? I know it's the first aliyah broken up into 3 parts but it would be handy to be able to pull that from the response as well.

`TimedEvent` type annotations do not expose timing information

When generating a calendar with candle lighting times in Typescript, the TimedEvents representing candle lighting do not include any way to actually access the timing information.

import { HebrewCalendar, Location, TimedEvent } from "@hebcal/core";

HebrewCalendar.calendar({
    year: 2022,
    month: 8,
    candlelighting: true,
    location: Location.lookup("Baltimore"),
    noHolidays: true
}).forEach(event => {
    console.log(event.eventTime); // <-- Refuses to compile
    console.log((event as TimedEvent).eventTime); // <-- Refuses to compile
});

The .d.ts entry for TimedEvent does not include entires for eventTime or eventTimeStr, and the class itself does not expose any getter methods for the same.

Property 'eventTime' does not exist on type 'TimedEvent'.

Trying to retrieve the information from the Gregorian Date also fails, because timing information is lost in the conversion to HDate.

HebrewCalendar.calendar({
    // ...
}).forEach(event => {
    console.log(event.getDate().greg()); // <-- Prints 2022-08-05T00:00:00Z (for example)
});

I'm happy to write a PR if you'd like, but I didn't know if you manually edit the .d.ts or if it's generated, or if you wanted to expose the properties or write getters for them.

Zemanim issue ?

hi wrote the following code:

import {HebrewCalendar, months, HDate, Location, Event, ParshaEvent, Zmanim} from '@hebcal/core';

const loc = Location.lookup('Jerusalem');
const wed = new Date(2023,9,20);
const zeman = new Zmanim( wed, loc.getLatitude(), loc.getLongitude());

console.log("sunrise:" + zeman.sunrise())
console.log("sunset:" + zeman.sunset())

the output i'm getting is :

sunrise:Fri Oct 20 2023 06:45:38 GMT+0300 (Israel Daylight Time)
sunset:Fri Oct 20 2023 18:01:50 GMT+0300 (Israel Daylight Time)

it's writing "Fri" as for Friday instead of Wednesday
also, it's outputting GMT+0300 instead of +2
also it's outputting "Oct" instead of September

what am i doing wrong ?

if i send in the Date (2023 , 8 , 20) then it will get the right resualts (meaning you are still using based on 0-11 months
but still the GMT is wrong

21 Nisan 5781 is missing ParshaEvent

maybe it's not relevant any more. but if it's caused by an algorithm problem it could occur again.

thank you!

edit: mjradwin you are right. my bad.

Can't access Location().getElevation

In version 5.2.1 I could access to the elevation of location like:
let c = Location.lookup(someCityName).getElevation();
In version 5.2.2, I can't any more
Can you fix it?
Thanks a lot

TypeScript type declaration error

I am encountering a TypeScript type declaration error in my React TypeScript project when using the package. Although the package includes type declarations (hebcal.d.ts), TypeScript fails to recognize them.

The error message I receive is as follows:

Could not find a declaration file for module '@hebcal/core'. '../node_modules/@hebcal/core/dist/index.mjs' implicitly has an 'any' type. There are types at '../node_modules/@hebcal/core/hebcal.d.ts', but this result could not be resolved when respecting package.json "exports". The '@hebcal/core' library may need to update its package.json or typings.

Interestingly, when I remove the following lines from the package.json of the package:

"exports": { 
    "import": "./dist/index.mjs",
    "require": "./dist/index.js"
  },

The error is resolved. However, my concern is that when I deploy my project to platforms like Vercel or Netlify, I am unable to access and modify the package.json file to fix the issue.

Custom export - missing data

Thanks for making Hebcal available!

I found some data missing when trying the following imports into Google Calendar, see attached screenshot:

  1. Zmanim for Candle lighting and Havdalah only highlighted in blue.
  2. Zmanim for all events highlighted in grey.

With export 1 the Havdalah times are missing for:

  1. motzei Rosh Hashana
  2. motzei Yom Kippur

This happens yearly.

Screenshot 2022-06-17 18 51 25

iCloud

why can i add this calendar automatically to icloud?

get full month object

How to get an object of the whole month or year
Like hebcal() in the hebcal-js package?

Expo/React-Native support

Thank you very much for making hebcal ES6 compatible!
I am trying to use it in my Expo/React Native project, but, unfortunately, the package is crashing with various errors. E.g.

TypeError: undefined is not an object (evaluating '_core.HebrewCalendar.calendar')

You can see it yourself by installing expo, doing expo init, and then pasting some of your demo code into the App.tsx.

Any help is greatly appreciated!

missing translation for rosh hashana

the render function on Rosh Hashana event always returns the English string even when the locale parameter is set to 'he' or 'fr'
it's works fine for Rosh Hashana day 2 but not for day 1

for example:
events /*
[
HolidayEvent {
date: HDate { month: 7, day: 1, year: 5781 },
desc: 'Rosh Hashana 5781',
mask: 33,
attrs: [Object: null prototype] {}
},
HolidayEvent {
date: HDate { month: 7, day: 2, year: 5781 },
desc: 'Rosh Hashana II',
mask: 5,
attrs: [Object: null prototype] {}
}
] */

var translateToHebrew = events.map(ev=>ev.render('he') ); //[ 'Rosh Hashana 5781', 'רֹאשׁ הַשָּׁנָה יוֹם ב׳' ]

Set options.hour12 to true still returns the 24h format

Hi
The options.hour12 set to true seems to always return the 24h format in the generated strings (like Molad infos in the Mevarhim Shabbat object). Even if i force the local the string is in 24h format.
Is there something specific to do to have the 12h format in the result strings ?
Thank you

Typo in "hebcal.d.ts" file.

line #362

export function addLocale(locale: string, data: LocaleDate): void;

second argument should be LocaleData instead of LocaleDate

Is Hebcal's interpretation of the Eisenberg triennial cycle in error?

The Eisenberg triennial cycle for Va'yekhel-Pekudei seems to say that when these sections are read together in years 1 and 2 of a cycle and are apart in year 3, as is the case for 5780, 5781, and 5782, the reading from Va'yekhal is Ex: 35:1-36:19. Hebcal reports Ex: 36:20 - 28:20.

I've attached an annotated image of the relevant page from the Eisenberg document for Va'yekhel-Pekudei and marked the years corresponding to years 1 - 3, and indicated what Hebcal reports.

Capture

There also seems to be a discrepancy for Tazriah-Metzorah. The 5780-5782 cycle also seems to be a together, together, separate group but Hebcal does not report Lev 12:1 - 13:28.

It appears that Hebcal is using the next cycle, but that doesn't work for Acharei Mot, later this year.

Perhaps Hebcal doesn't use the Eisenberg calendar system to which Hebcal links? Have I misinterpreted Eisenberg's tables?

What the best way to get MGA Shema / Shacharit as 16.1 degrees

Hi
For MGA Shema and Shacharit there 3 opinion, here is a screenshot from MyZmanim showing them:
Captu re

Using the zmanim.sofZmanShmaMGA() and zmanim.sofZmanTfillaMGA() seems to return the time according to fixed 72 minutes, what the best way to get the time using 72 minutes as 16.1 degrees ?

Cannot use with Typescript

mkdir -p /tmp/hc
cd /tmp/hc
npm init -y
npm i typescript @hebcal/core @hebcal/noaa tslib
echo "export * from '@hebcal/core'" > index.ts
cat >tsconfig.json <<EOL
{
  "include": ["index.ts"],
  "compilerOptions": {
    "target": "ES2022",
    "module": "NodeNext",
    "declaration": true,
    "moduleResolution": "NodeNext",
    "importHelpers": true,
    "sourceMap": true,
    "inlineSources": true
  }
}
EOL
npx tsc

node_modules/@hebcal/core/hebcal.d.ts:1:29 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@hebcal/noaa")' call instead.

1 import { GeoLocation } from '@hebcal/noaa';
~~~~~~~~~~~~~~

Found 1 error in node_modules/@hebcal/core/hebcal.d.ts:1

See #365

Shabbat Times Gives Date But Not Times

Example call to RSS API:
https://www.hebcal.com/shabbat?cfg=r&leyning=off&geonameid=3173435

Output: Friday, September 09, 2022
Torah: Deuteronomy 21:10-25:19
Haftarah: Isaiah 54:1-10
Saturday, September 10, 2022

NOTE: I am using a Siri shortcut to parse the output, and will be happy to provide more info, if someone is here to read that.

EDIT: in fact, many parameters make no difference at all whether they included in the URL, excluded, and no matter what value is passed to them (on/off etc).

Shabbat Chol Hamoed Sukkot bug in REST API and HTML

You have a problem with using your own data on your website. For 2022-10-15 the "leyningmaftir" from your REST API is Numbers 29:26-29:31. This is the standard maftir for Chol Hamoed Sukkot, and is the same as Chabad's: https://www.chabad.org/parshah/default_cdo/aid/137613/jewish/Sukkot.htm

However, your website https://www.hebcal.com/holidays/sukkot-2022?i=on lists Numbers 29:29-34. Have no idea where this comes from other than it being the 4th aliyot of Hoshana Raba, the next day.

And, interestingly, your puzzling concatenation field, "leyningtorah" on that day shows: Exodus 33:12-34:26; Numbers 29:17-22, 29:20-25, 29:23-28, 29:26-31, 29:29-34 Which is not at all what is read. But the final 8 characters: "29:29-34" are the same as the odd "leyningmaftir."

GPL License

Hebcal is great.

I note that the various repos in the hebcal organisation are under a variety of licences.

I would like to use hebcal in my website's frontend but under the GPL this may only be possible if my website is open source, including the original unbundled js files. For this reason relatively few NPM packages are GPL. There is some conflicting advice at https://softwareengineering.stackexchange.com/questions/181082/can-i-use-a-gpl-licensed-piece-of-javascript-on-a-commercial-website and https://opensource.stackexchange.com/questions/4360/what-are-the-implications-of-licensing-a-javascript-library-under-gpl

Please will you confirm if this package can be used by a website that is not open source?

use of const enum may produce unexpected results

Shavua tov.

The flags dict is defined as a typescript const enum. This can lead to difficulties:

https://www.typescriptlang.org/play?target=9&jsx=0#code/JYWwDg9gTgLgBAbzgMwDYEMDmBnOBfFKCEOAcgAEALAUwCMBjdVAenumtIG4AobtgO2zxkcALxwA8rQBW1ejAB0yIiACi-GFGDVsACimz5C6hq07d3OFbjNmccjGwBaagA8wcmC6hEoALjgAd0p0GGoAN2ooS2s0LGxuAEpEnj4IQQhUagVUCExdZBTeAWxM7Nz8uJwFAGEACQBBAHFEoA

Input:

import { flags } from '@hebcal/core';

const f = Object.fromEntries(Object.entries(
    // @ts-expect-error: whatever
    flags
));

console.log(f);

console.log(flags.CHAG)

Output:

const f = Object.fromEntries(Object.entries(
// @ts-expect-error: whatever
flags));
console.log(f);
console.log(0 /* flags.CHAG */);
export {};

The correct flag for CHAG is 1. Code relying on flags.CHAG and thus-compiled will fail. I worked around this by copying the flags table into my code. A better solution would be to export the table as an object

export const flags = {
  // ...
} as const;

An even better solution would be to vend predicates instead of bitmasks.

Besoros tovos

Language mismatch between hDate.getMonthName and its documentation.

According to the ReadMe:

hDate.getMonthName() ⇒ string

Returns untranslated Hebrew month name.

Since it returns the English transliteration for the Hebrew month, either the docs should be:

Returns the English transliteration of the Hebrew month (without regard to locale).

Or the function should be changed to return the Hebrew month in Hebrew.

Molad renders always to english ?

hi, i have wrote the following code:

import {MoladEvent, Locale, HebrewCalendar, months, HDate, Location, Event, ParshaEvent, Zmanim} from '@hebcal/core';


const options = {
  year: parseInt(year),
  start: new Date(2023,9,14),
  end: new Date(2023,9,14),
  isHebrewYear: false,
  candlelighting: true,
  location: Location.lookup('Jerusalem'),
  sedrot: true,
  omer: true,
  shabbatMevarchim: true,
  molad: true,
  il: true,
  locale: 'he'
};


const events = HebrewCalendar.calendar(options);

for (const ev of events) 
{
  const hd = ev.getDate();
  const date = hd.renderGematriya(true);
  console.log("1: " + date);
  console.log("2: " + hd.getDay());
  console.log("3: " + ev.render('he'));  
  }

}

i have hard coded the date to the date that there is a MEVARCHIM and MOLAD

the outcome of this code is that when it get to the MOLAD event, although i specified 'he' in the rendering the outcome of the MOLAD is in English:

3: Molad Tishrei: Fri, 49 minutes and 0 chalakim after 5:00

HDate: Time ignored? Why?

I find this module to be extremely helpful for a project I'm working on, but why are hours ignored when creating a new HDate? Isn't it pretty important to know if an event if before or after sunset?
I originally posted this issue in hebcal-js, but then someone pointed me to this newer version of the module, so I'm posting it here, too.
As an aside, how come there's no mention of this es6 version on the original js port's readme?

Why does Chanukah start at 24th Kislev?

  1. This code shows "Chanukah: 1 Candle" for the 24th of Kislev, isn't Chanukah starting at the 25th?
  2. Is there any way to filter out the holidays that aren't relevant to me like Chag HaBanot, Rosh Hashana LaBehemot etc.?
    Thanks
  const events = HebrewCalendar.calendar({
    year: 5784,
    isHebrewYear: true,
    noModern: true,
    mask: flags.MINOR_HOLIDAY
  });

api for ios, for few shabat in advence

hello.
i have searched for option to get data for few Shabbat in advance by entering dates "from" - "till".
but its not working.
on the week days it works with choosing dates though.
why ?

Ofek Yerushalayim

Shalom uvrachah

Hebcal's zmanim calculations diverge significantly from the printed luchot commonly sold in jerusalem

without descending into a lengthy discussion of the halachic merits of the various approaches, it would be helpful to many gabbaim (and gabbai-affiliated nerds) to provide computed times which accord more-or-less with "the luach i bought in the shop"

my personal ignorance knows no bounds, nonetheless my cursory surveys of the relevant sugyas as well as the code suggest to me that if the elevation in jerusalem, or better yet at a given lat/long were taken into account in @hebcal/solar-time, then it would be possible for the gabbai-affiliated to soothe the hesitations of the gabbaim themselves where @hebcal/core integrations are concerned

Thank you for your consideration

besoros tovos

Is there a way to get parsha and even info?

For example I want a way to get the following string (in hebrew)

parshas vayijra shabbos chol hamoed

I had this exact functionality at some point with a single function without constructing the string myself, but I don't remember how I did it

Type definition for Event defines date incorrectly

https://github.com/hebcal/hebcal-es6/blob/d6bcd85d7963c5a316370f1eb3d0431d6c354831/hebcal.d.ts#L31C25-L31C25

    export class Event {
        /**
         * Constructs Event
         * @param date Hebrew date event occurs
         * @param desc Description (not translated)
         * @param mask optional holiday flags
         * @param attrs
         */
        constructor(date: HDate, desc: string, mask?: number, attrs?: any);
        getFlags(): number;
        getDesc(): string;
        basename(): string;
        url(): string;
        getDate(): HDate;
        render(locale?: string): string;
        renderBrief(locale?: string): string;
        getEmoji(): string;
        observedInIsrael(): boolean;
        observedInDiaspora(): boolean;
        observedIn(il: boolean): boolean;
        clone(): Event;
        getCategories(): string[];
        readonly date: Date;
        readonly desc: string;
        readonly mask: number;
        readonly emoji?: string;
        readonly memo?: string;
    }

readonly date: Date should instead be readonly date HDate.

Change class statics to global (file-level) const

Looks like the static monthNames inside of greg.js (and possibly others) cause problems for webpack and other older JS systems. Let's move any of these out of the class and make them private file-level const.

Module parse failed: Unexpected token (180:20)                                                                                                       friendly-errors 14:42:08
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|    * @type {string[]}
|    */
>   static monthNames = ['', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
|   /**

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.