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

Option to exclude observances #22

Open
ighunter opened this issue Jun 14, 2024 · 0 comments
Open

Option to exclude observances #22

ighunter opened this issue Jun 14, 2024 · 0 comments

Comments

@ighunter
Copy link

ighunter commented Jun 14, 2024

Google's calendars include significant days which are not actually public holidays. For example, from https://calendar.google.com/calendar/ical/en.za%23holiday%40group.v.calendar.google.com/public/basic.ics for South Africa:

BEGIN:VEVENT
DTSTART;VALUE=DATE:20240718
DTEND;VALUE=DATE:20240719
DTSTAMP:20240614T130816Z
UID:[email protected]
CLASS:PUBLIC
CREATED:20240530T091720Z
DESCRIPTION:Observance\nTo hide observances\, go to Google Calendar Setting
 s > Holidays in South Africa
LAST-MODIFIED:20240530T091720Z
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Nelson Mandela Day
TRANSP:TRANSPARENT
END:VEVENT

This is included in the output of getHolidays({ country: 'za', lang: 'en' }) with no way to distinguish it from a "proper" public holiday:

{
  "date": "2024-07-17T22:00:00.000Z",
  "name": "Nelson Mandela Day"
}

We would really like the ability to exclude these "observances".

For comparison, "proper" public holidays in Google's calendars seem to have DESCRIPTION:Public holiday. To complicate matters though, this is language-dependent... For example from https://calendar.google.com/calendar/ical/fr.french%23holiday%40group.v.calendar.google.com/public/basic.ics:

BEGIN:VEVENT
DTSTART;VALUE=DATE:20240714
DTEND;VALUE=DATE:20240715
DTSTAMP:20240614T132655Z
UID:[email protected]
CLASS:PUBLIC
CREATED:20240522T110451Z
DESCRIPTION:Jour férié
LAST-MODIFIED:20240522T110451Z
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:La fête nationale
TRANSP:TRANSPARENT
END:VEVENT

Perhaps the simplest would be to just include the "description" field (maybe only before the first \n) in the output from this library, and let the application filter on that.

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

1 participant