-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why does Chanukah start at 24th Kislev? #386
Comments
There are several ways to handle this. You can use the const mask = flags.ROSH_CHODESH | flags.YOM_TOV_ENDS | flags.MINOR_FAST |
flags.SPECIAL_SHABBAT | flags.MODERN_HOLIDAY | flags.MAJOR_FAST |
flags.EREV | flags.CHOL_HAMOED |
flags.LIGHT_CANDLES | flags.LIGHT_CANDLES_TZEIS | flags.CHANUKAH_CANDLES; Another way to handle it would be to do something like this: // generates 83 events
const events0 = HebrewCalendar.calendar({
year: 5784,
isHebrewYear: true,
noModern: true,
});
// reduces to 62 events
// note that Chag HaBanot, Rosh Hashana LaBehemot, Purim and Chanukah are all filtered out
const events = events0.filter((ev) => ! (ev.getFlags() & flags.MINOR_HOLIDAY)); In addition to |
I'll add that if you want to filter most minor holidays but include Purim and Chanukah, you can also do something like this: const events2 = events0.filter((ev) => {
const bn = ev.basename();
if (bn === 'Purim' || bn === 'Chanukah') {
return true;
} else {
return ! (ev.getFlags() & flags.MINOR_HOLIDAY);
}
}); Feel free to follow that example to get more fine-grained control over which holidays are included and which aren't. |
I noticed that the event.getCategories() function returns const events = HebrewCalendar.calendar({
start: new HDate(25, months.KISLEV, 5784),
end: new HDate(26, months.KISLEV, 5784)
});
console.log(events[0].getCategories()); |
Looks like this is a bug. We'll investigate and unless we find a compelling reason, we expect to change it so it matches the expected |
Thanks
The text was updated successfully, but these errors were encountered: