umulmrum / holiday Goto Github PK
View Code? Open in Web Editor NEWA PHP library that computes holidays. It's something :-)
License: MIT License
A PHP library that computes holidays. It's something :-)
License: MIT License
The Day of Repentance and Prayer in Germany is no Holiday in Germany since 1994.
Germany.php Lines 53 to 55 should be changed from
} else {
//$holidays->add($this->getRepentanceAndPrayerDay($year, HolidayType::OFFICIAL));
}
to }
it is still a holiday in the Free State of Saxony
https://github.com/umulmrum/holiday/blob/master/src/Filter/AbstractSortFilter.php#L12 should not contain a lower-cased namespacing. This causes problems in Symfony, as their ClassLoader checks for such cases in https://github.com/symfony/symfony/blob/5.x/src/Symfony/Component/ErrorHandler/DebugClassLoader.php#L380
In https://github.com/umulmrum/holiday/blob/master/src/Provider/Germany/Hesse.php, "Corpus christi" is not listed as a proper "day off" for Hesse, which looks like a bug to me. Do you remember why it is listed as "Other" in Hesse, but not in the other states of Germany?
https://www.rv.hessenrecht.hessen.de/bshe/document/jlr-FeiertGHE1952rahmen is the official list of holidays provided by the state, and it lists the days in https://www.rv.hessenrecht.hessen.de/bshe/document/jlr-FeiertGHE1952pP1, where "Himmelfahrtstag" (the german name) is officially listed.
While utilizing this library, I realised that support for tracking UK holidays is missing. To better cater to UK-based users, I propose the implementation of this feature in a future update.
btw: This PR potentially closes my issue.
On Oct 3 2019, I detected a small problem using your wonderful holiday detector: to avoid problems with the timezone, my code uses the following statement for checking for a holiday:
$today = new \DateTimeImmutable('today 13:00:00');
$holidayCalculator = new HolidayCalculator(new GermanyHolidayInitializer());
$holidayHelper = new HolidayHelper($holidayCalculator);
$isAHoliday = $holidayHelper->isDayAHoliday($today, NorthRhineWestphalia::ID);
This does not return true, as the filtering process checks for a starting time of 00:00:00. I must admit that I haven't found a proper way to fix that bug in your code, that's why I haven't directly submitted a PR. But I would love to hear your opinion about this - do I use your code wrong or is this really a bug?
Hi, nice library! On my first usage attempt, I get an error message, when I use HolidayHelper::getNoWorkDaysForTimespan()
:
$holidayCalculator = new HolidayCalculator(new GermanyHolidayInitializer())
$holidayHelper = new HolidayHelper($holidayCalculator);
$holidays = $holidayHelper->getNoWorkDaysForTimespan(
new \DateTime('2018-10-01'),
new \DateTime('2018-10-31'),
'DE-NW'
);
This throws a HolidayException: "Invalid location alias: SUNDAYS".
The problem is, that I have to add (at least) Sundays as an HolidayProvider:
$holidayCalculator->addHolidayProvider(new Sundays());
This is a bit confusing. I expected the getNoWorkDaysForTimespan()
method to add the provided $noWorkWeekdayProviders
automatically using $holidayCalculator->addHolidayProvider();
, if they are not added yet. This is already done in $temporaryHolidayCalculator
, but the line calculating sundays doesn't make use of use it.
Is this a bug?
Greets, spackmat :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.