-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
Automated holiday generator #152
Conversation
There's a one thing that came into my mind - some countries have multiple languages, e.g. https://github.com/commenthol/date-holidays/blob/master/data/countries/BE.yaml. Now, script works in a way, that it takes the first language (e.g. here it will take French for Belgium). Would we like to support multiple languages, and if yes, how? |
Google Calendar on Android doesn't seem to show fixed-date holidays for the next year but we already have some requests for this: We should at least 'try' to parse the repetition rule for holidays with fixed dates.
Ideally, we should import the other holidays and then allow filtering them out in the app itself but let's go with
That's been requested as well: #167
I assume the first language is the local default for countries with holidays in multiple languages? If yes, let's go with that. I'll consider adding support for multiple languages/regions some day. |
Thanks for the review! Later this week, I will write a parser for fixed-date holidays. |
Ok, thank you. |
@naveensingh I've found some time today and added a parser for fixed date holidays. Here's a sample ICS file that the script now creates: unitedkingdom.ics.zip. Some tech notes:
|
@tswistak Thanks for the quick work and detailed changelogs! I'll check it out tomorrow (next 10-15hrs)... |
Everything else looks good to me! I'm ready to merge this if you are. |
I'm also ready. I'll try to take a look sometimes if there are issues about holidays and, if needed, will fix or modify the generator. Just in case, feel free to ping me. |
Ok, thanks :) |
I've noticed that action has failed. I forgot to mention that you have to allow GitHub actions to create pull requests. You may find it in Actions ⇾ General ⇾ Workflow permissions |
Yep, allowed it. Now running it again... |
What is it?
Description of the changes in your PR
config.js
. The only thing that can be set outside is an environment variable to set whether the script should write logs to the console.config.js
.date-holidays
unfortunately doesn't support some countries that already had holidays: India, Kazakhstan, Pakistan and Sri Lanka. I've added TODO comments with links to issues on library's GH to not forget about those.date-holidays-ical
as I wrote in the original discussion because it had dependency to an old version ofdate-holidays
. Instead, I decided to use a separate library for generating ICS files.date-holidays
returns metadata with repeating rule. I could figure out from it which holidays have fixed dates. But the question is, whether we want to complicate that script this much.date-holidays
returns different kinds of holidays. I've decided to filter them, to have only public and bank holidays, since I've noticed that some countries don't have other filled out. Also, for me, it would be confusing to have also other holidays, but I can easily change it (again, it's just a variable inconfig.js
)uid
of each event is reproducible (sha-256 of country and date) to avoid duplicate entries after adding holidays in recurring years. I only hope that there isn't any country that has multiple holidays on the same date, so they don't get filtered out. I decided not to use the name of the holiday because some are localized, some not, so I don't consider the name as something constant.npm ci
to install packages on CI and commitpackage-lock.json
, but I specially omitted it, so the script always fetches the latest version of the library. I can only hope it won't end like faker and there won't be any major API changes between minor versions (there shouldn't, but who knows...).Fixes the following issue(s)
Acknowledgement