hebrew_date 1.0.14 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/hebrew_date.gemspec +1 -1
- data/lib/support/holidays.rb +12 -5
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cc5ea4f193fb1abfb9f8cde7e26e5e92183811ad
|
|
4
|
+
data.tar.gz: b2e5b309c52d59bbe67e9aef4a9bf54575009375
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d4680aa9fdbfaa0ebe37b7e5f8d51da1a5985fa138fc59c6baa2a89e42e1cbe9dbd4fb2398edf782c939e92a160d6b7918445dd4db39aef477eacc5dcd3ac303
|
|
7
|
+
data.tar.gz: 9d0e7ff105fcbe310fc1f4bd7a695f476cfb271e6b38d09a8fa7d65059004355f15489b32aba921258a6c5b3cf13f8b12f553778c931403290b9036c7f7d28e9
|
data/hebrew_date.gemspec
CHANGED
data/lib/support/holidays.rb
CHANGED
|
@@ -260,16 +260,23 @@ module HebrewDateSupport
|
|
|
260
260
|
end
|
|
261
261
|
|
|
262
262
|
# Get the number of the Omer for this day, or nil if there isn't one.
|
|
263
|
+
# @param for_night [Boolean] if true, give the Omer count for the previous
|
|
264
|
+
# night - i.e. 1 more than the Omer for the current day.
|
|
263
265
|
# @return [Integer]
|
|
264
|
-
def omer
|
|
265
|
-
|
|
266
|
+
def omer(for_night=false)
|
|
267
|
+
for_night_offset = for_night ? 1 : 0
|
|
268
|
+
if for_night && @hebrew_month == 1 && @hebrew_date == 15
|
|
269
|
+
1
|
|
270
|
+
elsif for_night && @hebrew_month == 3 && @hebrew_date == 5
|
|
271
|
+
nil
|
|
272
|
+
elsif @hebrew_month == 1 && @hebrew_date >= 16
|
|
266
273
|
# Nissan, second day of Pesach and on
|
|
267
|
-
@hebrew_date - 15
|
|
274
|
+
@hebrew_date - 15 + for_night_offset
|
|
268
275
|
elsif @hebrew_month == 2 # Iyar
|
|
269
|
-
@hebrew_date + 15
|
|
276
|
+
@hebrew_date + 15 + for_night_offset
|
|
270
277
|
elsif @hebrew_month == 3 && @hebrew_date < 6
|
|
271
278
|
# Sivan, before Shavuos
|
|
272
|
-
@hebrew_date + 44
|
|
279
|
+
@hebrew_date + 44 + for_night_offset
|
|
273
280
|
end
|
|
274
281
|
end
|
|
275
282
|
|