-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add locale for es-AR #42
Comments
A good source that answers all questions except the algorithms for calculations is this: https://www.lanacion.com.ar/feriados |
Hello @cjbarroso,
To add this locale, we need the following:
With this data we can then flesh out the Locale |
Official list of holidays: https://www.argentina.gob.ar/interior/feriados This list is defined during the previous year. It's different each year, as several holidays are moved around.
All holidays are nation-wide, although some of them are for certain religions (for the purposes of this API, if there's no way to mark them, they should be skipped).
Some of them are variable dates.
All holidays in the site above are officially declared by the government.
There's no clear definition for it in this country, it depends on government definitions. Your best bet is to query the site and check where they land.
Some of them are.
They change every year. @lauft I made a snippet to scrap the holiday list from the official site, although it's on js, I think you (or someone willing to create a PR in this repo!) may adapt it to what you need here: https://gist.github.com/elamperti/85a539d9b721cdb5dd5cf09f1f084398 Feel free to add me as reviewer if needed in the PR for this locale. |
@elamperti @cjbarroso The aim of holidata is not to scrape holiday dates from other websites and present them, but to algorithmically calculate the holiday dates based on the laws that define them. (Although it can use such data for cross-checking - see below) The official site mentions Ley 27.399 (LAW ON THE ESTABLISHMENT OF HOLIDAYS AND LONG WEEKENDS) which lists the national immobile holidays and the national transfer holidays as well as the non working days and the rules for the long weekends. IMHO This is the point where we have to start from, translating the specifications mentioned in the law into the If you can provide the holiday data, preferrable for all years from 2011 to 2021, we can use it to create a test base and develop the locale against that, e.g.
|
@lauft I think you are underestimating the chaotic nature of argentinean politics: yes, there is a law to determine holidays, but it is modified from one year to other depending on political decisions. Bridge holidays depend on several (human) factors and weight of tourism, economy and education. Considering the impact of COVID-19 this year, I expect to see more changes for next year. As I mentioned earlier, some of the dates are fixed (new year, christmas, independence day and a few others). Carnival days can be calculated based on easter (but bridge days around them will vary non-deterministically year to year). Other days won't be possible to calculate and, again, your best bet there will be to follow the official website. Some holidays are recent, for example "Paso a la Inmortalidad del Gral. Güemes" was introduced in 2016, "Día de la Sobernía Nacional" was moved around in 2015. Flag day (20/jun) was declared a fixed-date holiday in 2017. I wish it were as easy as creating a set of rules or just reading a law once, but it's a live and breathing beast. If scraping is not an option, the locale should be maintained -at least- yearly to update dates, and considering how fast things have changed here before, the API couldn't be trusted. I don't know if there's a viable solution for this case. |
@elamperti You are 100% right, but do not think I underestimate the task! 😉 Scraping is definitely not an option. Instead of just copying the dates from other sources, holidata goes back to the roots by incorporating the laws/decrees that define the holidays and reproduces the dates from there. So I expected that there will be maintenance, as with every other locale. The trick is to keep it minimal. So why doing the same process as the official site? For one scraping heavily depends on the API's stability and a website is definetly a live and breathing beast compared to standard interfaces (REST/SOAP/...) - and also those can be pretty nasty. So there is maintenance in any case... A daring endeavour? Yes, indeed. Feasible? Let's take it step by step! As proposed I would start with Ley 27.399. This gives the basis for 2017 and following. Article 6 defines the rule how the transferrable holidays have to be shifted, so we are good here. The tricky part comes with Article 7:
Here we have to dig out all the decrees (like Decreto 717/2019) and incorporate them as well. And this will be be the regular maintenance task for this locale: Checking 50 days before the end of the calendar year for such a decree and encode into holidata. For start we can focus on 2020, but holidata provides the data of all locales since 2011 and I would hate |
Hi, I hope it helps to complete the data from 2011. 2011 - Source: Google 2012 - Source: Google 2013 - Source: Google 2014 - Source: Google 2015 - Source: Google 2016 - Source: Google 2017 - Source: Google 2018 - Source: Google 2019 - Source: Google 2020 - Source: Google 2021 - Source: Google Regards. |
Good luck trying to infer holidays from a law: just two weeks ago the government canceled a bridge holiday only to restore it 3 days before the actual date. It's a complete mess and just getting dates from laws is not feasible (just look at the holidays listed above). I do understand scrapping an official site is not the way holidata wants to handle it, but I see no other reliable way to do it really. |
I largely authored this Python-based algorithmic holiday generator so that this would not be needed, and hence I hate to suggest that, but maybe we could just create a Locale that has:
|
We need the holiday locale for Argentina.
You can find the goverment issued list of holidays and non-labourable days here.
I can happily provide a script for scrap and convert to any format you need.
The text was updated successfully, but these errors were encountered: