Coder Social home page Coder Social logo

hebcal-go's Introduction

hebcal-go

Build Status Go Report Card GoDoc

Hebcal is a perpetual Jewish Calendar. This library converts between Hebrew and Gregorian dates, and generates lists of Jewish holidays for any year (past, present or future). Shabbat and holiday candle lighting and havdalah times are approximated based on location. Torah readings (Parashat HaShavua), Daf Yomi, and counting of the Omer can also be specified. Hebcal also includes algorithms to calculate yahrzeits, birthdays and anniversaries.

Hebcal was created in 1992 by Danny Sadinoff as a Unix/Linux program written in C, inspired by similar functionality written in Emacs Lisp. This Golang implementation was released in 2022 by Michael J. Radwin.

Many users of this library will utilize the HebrewCalendar and HDate interfaces.

Hebcal incorporates and uses several related packages:

  • dafyomi: Daf Yomi, a daily regimen of learning the Babylonian Talmud (Bavli).
  • event: an interface for calendar events.
  • greg: converts between Gregorian dates and R.D. (Rata Die) day numbers.
  • hdate: converts between Hebrew and Gregorian dates. Also includes functions for calculating personal anniversaries (Yahrzeit, Birthday) according to the Hebrew calendar.
  • hebcal: provides functionality for calculating Jewish holidays, candle-lighting and havdalah times, and fast start/end times.
  • locales: translations and transliterations of Jewish holiday names into several languages.
  • mishnayomi: calculates the Mishna Yomi, a program of daily learning in which participants study two Mishnayot each day.
  • molad: calculates the time at which the New Moon is born.
  • nachyomi: calculates Nach Yomi, a daily regimen of learning the books of Nevi'im (Prophets) and Ketuvim (Writings).
  • omer: calculates the Sefirat HaOmer.
  • sedra: weekly Torah reading (Parashat HaShavua).
  • yerushalmi: Yerushalmi Yomi, a daily regimen of learning the Jerusalem Talmud.
  • zmanim: calculates halachic times.

hebcal-go's People

Contributors

maxbgreenberg avatar mjradwin avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

hebcal-go's Issues

Zmanim list

the list of zmanim printed by hebcal currently prints MGA zmanim after GRA zmanim for zof zman shma and tefillah. this bothers me as it seems to me zmanim should be printed earliest to latest. I also think shitas hagra should be labeled explicitly rather than be stam. I've already implemented these changes in my fork of hebcal. Is this something might be merged upstream?

סוף זמן אכילה וביעור חמץ

I think a useful feature to add would be for an option to print sof zman achilas chametz and sof zman biur chametz on erev pesach. I was initially thinking of adding that to the zmanim list contingent on it the condition that the day is erev pesach is met. but then I realized that it may be better to leave that as just the zmanim that apply every day. Perhaps instead it could be added to the -c option, being printed alongside candle lighting. Do people think this could be useful? The zman for achilas chametz is the same as sof zman tefilla. the zman for sof zman biur is one halachik hour later.

Provide ability to use time.Time

Being able to convert between dates would be a lot nicer if we could directly use a time.Time instead of arbitrary numbers (especially when it comes to storing and searching dates in a DB, most ORMs have a wrapper for time.Time).

Also, this is an incredibly helpful package (esp. because it showed up right as I needed it) and I can definitely say I will be using it quite a bit in the near future. So thank you very much for making it.

Dawn and dusk in zmanim

Currently, the list of zmanim includes dawn and dusk (6 degrees of solar depression). however, i cannot find any halakhic significance to these zmanim and was wondering why they belong in the zmanim list. in my fork, i've removed them from the list. I've implemented a bein hashmashos zman in place of dusk which occurs 13.5 minutes before a solar depression of 7.083 degrees. hebcal currently uses dusk (6 degrees of solar depression) as the zman for hadlakas neir chanukka. I am curious as to the basis of this decision. the shitos i've seen for zman hadlaka neir chanukka are sunset, tzeis hakhochavim, and bein hashmashos (the latter 2 are based on the lashon of shulkhan arukh of zman being im sof shkias hachama). For this reason, in my fork, i've implemented zman hadlakas neir chanukka as being at bein hashmashos. if there is no reason to keep the 6 degree dawn and dusk, I will submit that change as a PR

Not possible to store dates in DB (easily)

Up until v0.9.11 I was storing the HDate directly in the database (as a JSON object). However, now that the fields are private this is no longer possible as the JSON encoding no longer discovers those fields. Would it be possible to add support for the encoding/json.Marshaller and Unmarshaller interfaces (or simply make the fields public again)?

Add an event flag for torah readings

Would it be possible to have an event flag that covers days the torah is read? As far as I can tell, there is no particular way to filter for that.

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.