Skip to content
This repository was archived by the owner on Jul 16, 2026. It is now read-only.

Commit 852a3eb

Browse files
committed
HDate().candleLighting() and HDate().havdalah()
1 parent 7dfb214 commit 852a3eb

13 files changed

Lines changed: 110 additions & 50 deletions

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ version 2.2.0 alpha (2014-05-12)
33
Always set event based on years
44
Remove holidays.IGNORE_YEAR
55
Fix bug with giving a name to HDate().setMonth()
6+
Add HDate().candleLighting() and HDate().havdalah()
67

78
version 2.1.2 (2014-04-04 [5 Nisan 5774])
89
Fix sourcemap links

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ Returns a Boolean, whether or not the event applies for a given date.
407407

408408
`date`, if provided, can be a `Hebcal.HDate` or a Gregorian `Date`. If undefined, defaults to the current date.
409409

410-
`il`, if provided, should be a Boolean whether or not you are in Israel. If undefined, defaults to the value of `Hebcal.holidays.Event.isIL`.
410+
`il`, if provided, should be a Boolean whether or not you are in Israel. If undefined, defaults to the value of `Hebcal.holidays.Event.isIL`. As of v2.2.0, `il` defaults to the `il` property of `date`.
411411

412412
#### `Hebcal.holidays.Event.prototype.masks()`
413413

@@ -431,7 +431,9 @@ The number of minutes after sunset can be customized with the `Hebcal.holidays.E
431431

432432
#### `Hebcal.holidays.Event.prototype.routine()`
433433

434-
Returns a Boolean, whether or not this is a "routine" event. This can be used by programs wishing to omit certain types of events.
434+
This property was added in v2.2.0.
435+
436+
Returns a Boolean, whether or not this is a "routine" event. Routine events are not included by default in `Hebcal.HDate.prototype.holidays()`.
435437

436438
The default routine events are `Shabbat` and `Erev Shabbat`. This can be customized by changing the `Hebcal.holidays.Event.prototype.routine.names` array.
437439

@@ -704,7 +706,7 @@ Sets the year of the date. Returns the object it was called upon.
704706

705707
### `Hebcal.HDate.prototype.setMonth(month)`
706708

707-
Sets the month of the date. Returns the object it was called upon.
709+
Sets the month of the date. Accepts a number or string. Returns the object it was called upon.
708710

709711
### `Hebcal.HDate.prototype.setTishreiMonth(month)`
710712

@@ -812,6 +814,14 @@ Returns an object containing halachik times (zemanim) for the day. Each property
812814

813815
You can add a zeman to be returned with `Hebcal.HDate.addZeman()` (aliased as `Hebcal.addZeman()`).
814816

817+
### `Hebcal.HDate.prototype.candleLighting()`
818+
819+
Return a `Date` object with the candle-lighting time for that day, or `null` if there is none. Added v2.2.0.
820+
821+
### `Hebcal.HDate.prototype.havdalah()`
822+
823+
Return a `Date` object with the havdalah time for that day, or `null` if there is none. Added v2.2.0.
824+
815825
### `Hebcal.HDate.prototype.next()`
816826

817827
Return tomorrow. Or rather, an `HDate` representing the next day.
@@ -893,10 +903,14 @@ Return `this.__gregmonth` internal, or a new `Hebcal.GregMonth`. This method was
893903

894904
Call `getYearObject()` of `this.getGregMonthObject()`. This method was added in Hebcal JS 2.1.
895905

896-
### `Hebcal.HDate.prototype.holidays()`
906+
### `Hebcal.HDate.prototype.holidays(all)`
897907

898908
Return an array containing `Hebcal.holidays.Event`s applying to the current day.
899909

910+
The `all` argument was added in v2.2.0. If not included, it defaults to `false`. The action in prior versions is as if `true` was passed.
911+
912+
If `all` is not present, or is false, the function only returns events that apply to the current location, and omits "routine" events. For a definition of "routine", see `Hebcal.holidays.Event.prototype.rotuine()`. If `all` is present and is `true`, or using a version before 2.2.0, all events are returned, whether or not they are relevant.
913+
900914
### `Hebcal.HDate.prototype.omer()`
901915

902916
Return a number representing the day of Sefirat Omer. Returns 0 if not during Sefirah.

client/hebcal.js

Lines changed: 29 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/hebcal.js.map

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/hebcal.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/hebcal.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/hebcal.noloc.js

Lines changed: 29 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/hebcal.noloc.js.map

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/hebcal.noloc.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/hebcal.noloc.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)