Categories: None [Edit]
hebcal
# HebCal
Determines the date of Passover for a Gregorian year. Also includes boolean functions to check whether a date is a Jewish holiday, Fast Day or Rosh Chodesh.
Supported languages:
Javascript
Ruby
## Installation as a Ruby gem
Add this line to your application's Gemfile:
gem 'hebcal'
And then execute:
$ bundle
Or install it yourself as:
$ gem install hebcal
## General notes
1. 3- and 4-digit years are supported, so the domain of valid years is 100-9999. For years before the Gregorian transition (1582), the transition is ignored and the proleptic Gregorian calendar is used.
## Ruby Version
### To Run Unit Tests
$ rake test
### To Use
#### Calculating the date of Passover
1. At the top of the file where the class is defined, declare `require `hebcal``
1. In the class, declare `include HebCal::Passover`
1. `WhenIsPesach(yyyy)` returns a Ruby Time object representing midnight on the first day of passover, where `yyyy` is the Gregorian year
Note that the date returned is the first day of Pesach, not the day on which Pesach begins at sunset.
#### Finding out if a date is a holiday
1. At the top of the file where the class is defined, declare `require `hebcal``
1. In the desired class, declare `include HebCal::Holidays`
1. `IsPesach(d)` returns true iff d is a Ruby Time object representing a date during Pesach. Note that the day on which Pesach begins at sunset returns false.
1. The following functions work in a similar way to `IsPesach()`:
1. `IsShavuot()`, `IsRoshHashanah()`, `IsYomKippur()`, `IsSukkot()`
1. `IsRegel()`: `IsPesach() || IsShavuot || IsSukkot()`
1. `IsMoed()`: Hol HaMoed Pesach or Hol HaMoed Sukkot
1. `IsYomTov()`: `IsPesach() || IsShavuot() || IsRoshHashanah() || IsSukkot()) && !IsMoed()`
Note that IsYomTov(yk) == false, where yk is the date of Yom Kippur.
1. `IsPurim()`, `IsHanuka()`
1. `Is10Tevet()`, `IsTaanitEster()`, `Is17Tamuz()`, `Is9Av()`, `IsFastOfGedalia()`
1. `IsTaanit()`: `Is10Tevet() || IsTaanitEster() || Is17Tamuz() || Is9Av()...
Total
Ranking: 129,818 of 183,539
Downloads: 4,359
Daily
Ranking: 26,098 of 183,521
Downloads: 8
Downloads Trends
Ranking Trends
Num of Versions Trends
Popular Versions (Major)
Popular Versions (Major.Minor)
Depended by
Rank | Downloads | Name |
---|
Depends on
Rank | Downloads | Name |
---|
Owners
# | Gravatar | Handle |
---|---|---|
1 | IYBetesh |