vacanza / python-holidays

Generate and work with holidays in Python
https://pypi.org/project/holidays
MIT License
1.43k stars 457 forks source link

Zurich half-day holidays in Switzerland #784

Open dragoon opened 1 year ago

dragoon commented 1 year ago

Zurich has 2 half-day holidays every year: Sechseläuten and Knabenschiessen. I wonder if we can somehow include this in the library?

But then not sure how to mark them. I don't know if any other country has something similar so it is worth doing.

dr-prodigy commented 1 year ago

Hi @dragoon thank you! I can't give a final answer to your question, but if there are other countries with similar cases in existence, as of now we surely neither currently manage, nor even know them :-D

This said, to avoid implementing an impacting change for those 2 half days only (which I currently don't see a point in), I would suggest (very trivially..) to manage them just adding a note to their names, such as "Sechseläuten (half day)" or similar.. as we already do with observed holidays, in other words. Not very accurate, while still better than nothing! 👍

mborsetti commented 1 year ago

I observe that a similar situation takes place for NYSE, which has so-called reduced trading hours days when it closes at 13:00 (see footnotes at https://www.nyse.com/markets/hours-calendars#holidays).

Having some sort of standardized mechanism to handle those days would be nice and potentially very useful. Maybe add a partial boolean argument to the method, which if set to True will cause partial holidays to be returned as well as the full day ones, and that the partial ones have a label which ends with a country-standardized annotation in brackets (e.g., for NYSE, "Day after Thanksgiving [13:00 close]"?

alexanderschulze commented 1 year ago

(+1) We have it in Germany too for Christmas Eve (12-24) and New Years Eve (12-31). Right now, we manually add these edge cases in our application, but support for a flag would be preferred.

antti-begin commented 1 year ago

I came from https://github.com/commenthol/date-holidays to check, how the python library is faring, when dealing with shortened workdays. I'm just adding 2 euro cents. The node version has type for every holiday https://github.com/commenthol/date-holidays#types-of-holidays I have a vague feeling, that we need more attributes to holidays. Is it a shortened day or what kind of holiday this is. How many hours is the workday shortened or at what time does the workday end. Use case: Baltic states use shortened workdays before some public holidays. Estonian rule is simple, shorten the workday by 3 hours. The shortened days are fixed (23.02, 22.06, 23.12 and 31.12). Latvia and Lithuania shorten the workday by 1 hour, but they have bizarre rules, how the public holidays are moving from weekend to weekdays and thus, the shortened days are also not fixed.