Skip to content

Releases: hebcal/hebcal-es6

add, subtract, and deltaDays

29 Jul 20:58
Compare
Choose a tag to compare

hDate.add(number, [units]) ⇒ HDate

Returns a cloned HDate object with a specified amount of time added

Units are case insensitive, and support plural and short forms.
Note, short forms are case sensitive.

Unit Shorthand Description
day d days
week w weeks
month M months
year y years

hDate.subtract(number, [units]) ⇒ HDate

Returns a cloned HDate object with a specified amount of time subracted

hDate.deltaDays(other) ⇒ number

Returns the difference in days between the two given HDates

The result is positive if the two dates are in chronological order,
i.e., if date 1 comes chronologically BEFORE date 2, and negative
if the order of the two dates is reversed.

The result is zero if the two dates are identical.

import {HDate, months} from '@hebcal/core';

const hd1 = new HDate(25, months.KISLEV, 5770);
const hd2 = new HDate(15, months.CHESHVAN, 5769);
const days = hd1.deltaDays(hd2); // 394

const hd4 = new HDate(15, months.CHESHVAN, 5769);
const hd5 = hd4.add(1, 'weeks'); // 7 Kislev 5769
const hd6 = hd4.add(-3, 'M'); // 30 Av 5768

3.22.0: add and subtract

29 Jul 17:39
Compare
Choose a tag to compare

hDate.add(number, [units]) ⇒ HDate

Returns a cloned HDate object with a specified amount of time added

hDate.subtract(number, [units]) ⇒ HDate

Returns a cloned HDate object with a specified amount of time subracted

3.21.0: Add Sefirat HaOmer to omer event memo

04 Jul 14:18
Compare
Choose a tag to compare
  • Add Sefirat HaOmer to omer event memo (Today is 46 days, which is 6 weeks and 4 days of the Omer and Eternity that is in Majesty / נֶּֽצַח שֶׁבַּמַּלְכוּת)

  • Change emoji of modern Israeli holidays to Israeli flag

3.20.3: Emoji bugfix

30 Jun 03:24
Compare
Choose a tag to compare

New Event.getEmoji() returns a string such as 🕯️ or ✡️ or 🍏🍯 for holidays. Returns null when no emoji applies.

Now correctly using Waxing Crescent Moon emoji 🌒 for Rosh Chodesh.

3.20.1: Emoji support

29 Jun 23:16
Compare
Choose a tag to compare

New Event.getEmoji() returns a string such as 🕯️ or ✡️ or 🍏🍯 for holidays. Returns null when no emoji applies.

3.19.0: Rosh Hashana LaBehemot

25 Jun 14:48
Compare
Choose a tag to compare
v3.19.0

Rosh Hashana LaBehemot

v3.18.0

21 Jun 19:52
Compare
Choose a tag to compare
Set CandleLightingEvent.memo = <parsha haShavua name> on Friday nights

v3.17.5

01 Jun 15:37
Compare
Choose a tag to compare
Fix date formatting for early CE years

v3.17.4

24 May 15:16
Compare
Choose a tag to compare
Disable candle-lighting for Gregorian years < 100

v3.17.3

23 May 04:18
Compare
Choose a tag to compare
Don't generate URLs for Events prior to Gregorian year 100