Skip to content
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

Example how to exclude holiday types with HebrewCalendar.getHolidaysOnDate #70

Closed
TheBestMoshe opened this issue Oct 7, 2021 · 2 comments
Assignees

Comments

@TheBestMoshe
Copy link

HebrewCalendar.getHolidaysOnDate(date, false) returns an Event array if there are any events for the given date. How do I select what kind of events I want? For example, if I only want Chagim, how would I do it?

I see Hebcal has flags. However, .getHolidaysOnDate does not have an option to pass them in. I also see that Event has a mask field, which seems to identify the specific holiday. However, how can I figure out which category a holiday is a part of?

@TheBestMoshe TheBestMoshe changed the title Example how exclude holiday types with HebrewCalendar.getHolidaysOnDate Example how to exclude holiday types with HebrewCalendar.getHolidaysOnDate Oct 7, 2021
@mjradwin mjradwin self-assigned this Nov 22, 2021
@mjradwin
Copy link
Member

Hi, thanks for the bug report. It looks like we could do a better job of documenting which holidays use which flags. You can certainly call filter() on the results of this function to select holidays you prefer based on their flags.

In the meantime, if you want fine grained control over which holidays are included, you can consider using the well documented HebrewCalendar.calendar() function. You can even specify a single date using that function by setting the start and end parameters to the same Date or HDate value.

https://github.com/hebcal/hebcal-es6/blob/main/README.md#HebrewCalendar.calendar

mjradwin added a commit that referenced this issue Jun 16, 2022
@mjradwin
Copy link
Member

@TheBestMoshe I'm going to close this issue as I think recent documentation changes may have made it easier to solve your problem. If you have additional questions, feel free to reopen

https://github.com/hebcal/hebcal-es6/blob/main/README.md#flags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants