Yasumi v1.8.0 Is Now Available

Posted

2018-02-21

Length

2 minute read


Yasumi v1.8.0 is now available as of Wednesday, February 21st supporting Russia and Estonia thanks to the work of Gedas Lukošius.

As already announced in my previous post, 1.8.0 will be the last release to officially support PHP5.x. I think it's about time Yasumi will fully support PHP7 using its performance improvements.

Next to Russia and Estonia being part of the family, 1.8.0 includes a good number of fixes and changes as well.

First up Yasumi now supports objects implementing the DateTimeInterface and instances of the DateTimeImmutable class for functions that accept a date/time as a parameter. Here is an example using the isWorkingDay() function:

$date = new DateTimeImmutable('2018-10-10');
$isWorkingDay = Yasumi::create('USA', 2018)->isWorkingDay($date);

In certain situations you may want to use the provided holiday providers as a starting point for your own custom holiday provider.

Extending an existing holiday provider is easy and additional holidays can be added without a problem. To remove holidays as well, the removeHoliday function as been added.

A good example of such a situation is the observed holidays by the New York Stock Exchange. They follow the standard Federal U.S. holidays but also differ slightly. If you're curious how to do this, check out the new recipe Use a custom provider for uncommon providers in Yasumi's Cookbook.

Lastly, PHPStan (PHP Static Analyzer Tool) and Scrutinizer have been added to the build process to track and ensure the quality of Yasumi's code base.

The full release notes can be found here: Yasumi v1.8.0

Cheers!

Sacha