Closed nilshoerrmann closed 4 years ago
Yasumi is designed with no particular restriction on how holidays defined. It is possible to represent those holidays in Yasumi just as any other full holiday. What matters more is how you like to use that information in your application or project, i.e. your business case.
Christmas Eve and New Years Eve are both days where businesses have to close earlier by law in Germany (the time varies by federal state). So I've expected them to be included in the list of holidays, tagged in a way that I could filter those dates out. Still, both days are no official holidays and none of the available types really fits (well, "others" always works).
So I actually have two requests or questions:
Would you be open to include another type in the library, like "partly", that represent those days? With that kind of type, both days could be added to the German holidays while still keeping things filterable.
Additionally, would it be possible to to have an additional property defining if a holiday is silent or not (where silent means that there might a dancing ban or other restrictions for public events)? That's something different than the type because e. g. Good Friday is an official and silent holiday at the same time.
This issue has been open 60 days with no activity. Please remove the stale label or comment, or this will be closed in 10 days.
@nilshoerrmann My apologies for the prolonged response. As there are a few more such cases, I am in the process of redesigning how the holidays can get classified. Your examples of half days and 'silent' days could be supported as well.
This issue has been open 60 days with no activity. Please remove the stale label or comment, or this will be closed in 10 days.
I am using yasumi now for the first time (from germany) and we have the same problem with new years eve. If we have to decide, in my opinion, its more a working day then a holiday.
Look right under: "Public Life" https://www.timeanddate.com/holidays/germany/new-year-eve
@heikoter Yes it is not straightforward as it seems. In the end it may be only relevant how you want it to be in your own application, ie. your business rules/logic. Personally I tend to follow the official, legal definition of each country.
Perhaps the best way to look at this is how you in Germany distinguish Werktage
and Arbeitstage
(https://en.wikipedia.org/wiki/Business_day)
Look right under: "Public Life" https://www.timeanddate.com/holidays/germany/new-year-eve
I like the definition from the link: "New Year's Eve is traditionally a partial non-working day". So, is the glass half full or half empty, is it a holiday or not? That certainly depends on the perspective or the context but it's definetly a special day.
Personally, I think the German words "Werktag" and "Arbeitstag" are not helpful in this context: "Werktag" is everything Yasumi is not about and "Arbeitstag" always depends on the context of a person, it's not universal. And looking at New Years Eve: it's definetly a "Werktag" but not a full one because it preludes a public holiday and has reduced business hours.
So currently, Yasumi offers official
, observance
, season
, bank
and other
as types. My initial request was to have two additional types: partly
for those half business days, half closed days. And silent
for public holidays where the law forbids parties ("stille Feiertage"). I don't mind the actual names but it would be great if those day could be classified in and thus filtered by the library.
In the end it may be only relevant how you want it to be in your own application, ie. your business rules/logic.
As a developer, I do not have intimate knowledge of holiday rules and conventions in other countries than my own. I would prefer if I could delegate this kind of business logic to an external library like Yasumi.
If my application needs to show e.g. work-free days or days when banks are closed, I would like to get this information from the library rather than having to investigate the specific rules for each country supported by my application.
Obviously a library cannot support all possible use-cases, but I suspect that just a few more holiday categories could satisfy the need for the majority of applications. I previously submitted a loose proposal on holiday classification in https://github.com/azuyalabs/yasumi/issues/99.
delegate this kind of business logic to an external library like Yasumi.
That's what Yasumi is designed to do. :) Some case are clear and universal, some are not. The ones that are not, that is where the challenge is.
This issue has been open 60 days with no activity. Please remove the stale label or comment, or this will be closed in 10 days.
In Germany, Christmas Eve and New Years Eve are special days where businesses close around noon. They are not offical holidays but "half-day holidays" by law. This applies to all federal states.
There are also "silent days" where things like dancing are prohibited. Those days vary between federal states.
Is there a way to represent those dates in Yasumi?