Releases: hebcal/hebcal-es6
add, subtract, and deltaDays
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 HDate
s
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
3.21.0: Add Sefirat HaOmer to omer event memo
-
Add Sefirat HaOmer to omer event memo (
Today is 46 days, which is 6 weeks and 4 days of the Omer
andEternity that is in Majesty / נֶּֽצַח שֶׁבַּמַּלְכוּת
) -
Change emoji of modern Israeli holidays to Israeli flag
3.20.3: Emoji bugfix
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
New Event.getEmoji()
returns a string
such as 🕯️ or ✡️ or 🍏🍯 for holidays. Returns null
when no emoji applies.
3.19.0: Rosh Hashana LaBehemot
v3.19.0 Rosh Hashana LaBehemot