The easy PHP Library for calculating holidays

Overview

Logo

GitHub Release Total Downloads Coding Standard Static analysis Testing Software License

Introduction

Yasumi (Japanese for 'Holiday'「休み」) is the easy PHP library that helps you retrieve the dates and names of holidays and other special celebrations from various countries/states. It is calculation and rule driven avoiding the need of a comprehensive database.

Many services exist that can provide holiday information, however are either not entirely free or only offer limited information. In addition, no exhaustive PHP library exists today covering a wide range of holidays and countries. PEAR's Date_Holidays library was a similar attempt, however it hasn't been updated for a long time.

Highlights

The goal of Yasumi is to be powerful while remaining lightweight, by utilizing PHP native classes wherever possible. Yasumi's calculation is provider-based (i.e. by country/state), making it easy to add new holiday providers that calculate holidays.

  • Straightforward API
  • Framework-agnostic
  • Use of Providers to easily extend and expand new Holidays
  • Common Holiday Providers
  • Accounts for the date/time when holidays have been officially established and/or abolished
  • Filters enabling to easily select certain holiday types (Official, Observed, Bank, Seasonal or Other)
  • Global Translations
  • Timezone aware
  • Implements ArrayIterator to easily process a provider's holidays
  • Fully documented
  • Fully unit tested
  • Composer ready, PSR-2 and PSR-4 compliant

Documentation

Yasumi’s documentation is available on https://www.yasumi.dev. You will find all the necessary information how to install Yasumi and also recipes how you can use Yasumi in your project.

Blog

Checkout the blog section on documentation site regularly for latest updates. Keeping you informed about any news, releases, etc. in a handy blog post format!

Contributing

Contributions are encouraged and welcome; I am always happy to get feedback or pull requests on Github :) Create Github Issues for bugs and new features and comment on the ones you are interested in.

If you enjoy what I am making, an extra cup of coffee is very much appreciated :). Your support helps me to put more time into Open-Source Software projects like this.

Buy Me A Coffee

License

Yasumi is open-sourced software licensed under the MIT License (MIT). Please see LICENSE for more information.

Comments
  • Missing holiday methods in ProviderInterface

    Missing holiday methods in ProviderInterface

    In v2.5 Yasumi::create now returns an instance of ProviderInterface, but this interface is missing most methods needed to actually do anything with holidays:

    • No isHoliday method
    • No getHolidayDates method (that is the one that my code is using)
    • No between method
    • No getHolidayNames method
    • No whenIs method

    These would seem like the necessary methods to get a list of holidays and check if a date is a holiday or what holidays are within a certain timeframe. ProviderInterface has no method at all to check for holidays - which is why my static analyzers report Method Yasumi\ProviderInterface::getHolidayDates does not exist, and anybody using static analyzers and Yasumi will get these kind of errors. The methods are currently still there in AbstractProvider, but according to ProviderInterface they are not necessary.

    bug no-issue-activity 
    opened by iquito 20
  • "Fronleichnam" missing as official Holiday

    Hi,

    "Fronleichnam" is missing as official holiday today. Why is that? Not listed in NRW nor Bayern. Don't know if others are missing, too.

    Thanks a lot

    bug 
    opened by pete1019 20
  • Germany: 2020-12-31 New Year’s Eve no Holiday

    Germany: 2020-12-31 New Year’s Eve no Holiday

    Hello, thanks a lot for the effort you put into yasumi.

    It shows for today (2020-12-31 New Year’s Eve) Holiday

    But officially there is no holiday today.

    Lets discuss!

    Thanks

    opened by pete1019 17
  • Possibility to Set default timezone

    Possibility to Set default timezone

    All of my dates I'm using are in UTC, if I want to compare them with the holidays I always need to change the timezone. So I think setting a default timezone either globally Yasumi::defaultTimezone or during creation as an extra parameter Yasumi::create(Germany::class, 2017, 'de_DE', 'UTC') would be very helpful. As long as the default timezone is not set, it uses the timezone provided by the initialize method. I'll create a PR once this is approved. :-D

    opened by IceShack 13
  • New translation for Norway’s national day

    New translation for Norway’s national day

    I believe the usual name for Norway's national day on 17 May is Grunnlovsdag (National Day) or Grunnlovsdagen (The National Day).

    I don't know of any official source to quote, but here are some examples:

    • Norske helligdager by Visit Oslo (turist agency) uses grunnlovsdagen.
    • Wikipedia entry – this article uses both grunnlovsdag(en) and nasjonaldagen, but grunnlovsdag is used in the tittle.
    • 2018 calendar by timeanddate.no uses grunnlovsdag – a website published by a Norwegan company.
    • A4 calendar by Almanakkforlaget – a Norwegian company selling printed calendars.

    Disclaimer: I am not a native Norwegian speaker, but being from Denmark, I can read the other Scandinavian languages. Perhaps a Norwegian can chip in here?

    enhancement 
    opened by c960657 13
  • Skip AbstractProvider when generating provider list

    Skip AbstractProvider when generating provider list

    In some cases, when filesystem iterator returned AbstractProvider.php after USA.php, provider list generator returned AbstractProvider as the provider for USA, as abstract provider has the ID constant set to US (I'm unsure why it has this constant at all). The mechanism is simple: loop checks USA.php, adds 'US' => 'USA' to the array, then checks AbstractProvider, and overwrites the USA provider by adding 'US' => 'AbstractProvider' to the output.

    To overcome this issue, I've expanded the condition checking if the class is a proper provider by checking if it's a subclass of AbstractProvider. That's why AbstractProvider won't be taken into consideration at all.

    bug 
    opened by leafnode 12
  • php-cs-fixer issue

    php-cs-fixer issue

    Running php-cs-fixer fix . --level=psr2 generates a massive list of changes, and breaks unit tests (it changes the namespaces for tests from Yasumi\Tests\NewZealand to Yasumi\tests\NewZealand)

    Are there some specific settings to use when running php-cs-fixer?

    opened by badams 12
  • Half-day holidays

    Half-day holidays

    opened by nilshoerrmann 11
  • Add substituted holidays for Australia

    Add substituted holidays for Australia

    Fixes #199.

    I don't know anything about Australian holidays, but perhaps @jbroudou can verify this?

    Basically we now mark both the original holiday and the substitute holiday as TYPE_OFFICIAL holidays. This applies to all holidays which are moved to the following Monday.

    bugfix 
    opened by c960657 11
  • Updated SouthKorea provider to apply the new substitute holidays changed in June 2021.

    Updated SouthKorea provider to apply the new substitute holidays changed in June 2021.

    Hi. The new substitute holidays bill was passed in korea on june 2021. I have updated SouthKorea provider and added tests for substitute holidays.

    1. All statutory holidays overlaping weekend or other holiday will be substitute at next working day.
    2. The above provisions shall be in force in 2022, but substitute holidays of second half of 2021 shall be applied by the supplementary provision.

    https://en.yna.co.kr/view/AEN20210629007500315 http://tbs.seoul.kr/eFm/newsView.do?typ_800=N&idx_800=3441140&seq_800=

    enhancement 
    opened by barami 9
  • List of countries / providers

    List of countries / providers

    What I really missed in the documentation was a list of providers that can be chosen. Ideally, there would be a list of all providers with:

    • Number of holidays in that provider
    • Some hint about how the holidays were chosen / how the holidays work in that country, as somebody might try to use the library for a country they do not know super well
    • Possible caveats. A good example is Switzerland, as explained in my other issue, where holidays are highly regional, yet there are some common denominators across the country

    That would make the usage of this library easier and less error-prone, and it could be a good short documentation of holidays in different countries in general, which can be useful even to people not using the library (just as a bonus).

    documentation no-issue-activity 
    opened by iquito 9
  • Custom Holiday

    Custom Holiday

    I can't reopen https://github.com/azuyalabs/yasumi/issues/230 issue so I created new.

    I expect that if I have holidays in Poland, and I add a new date, Yasumi::nextWorkingDay will take this into account. For example - in Poland we have holidays on December 24th, 25th, and 26th. If I add December 27th and run the script with the date 23rd, I expect that the next working day will be December 28th.

    $holidays = Yasumi::create( 'Poland', 2022 ); $holidays->addHoliday( new Holiday( 'Holiday 1', [], new \DateTimeImmutable( '2022-12-27' ) ) );

    var_dump( Yasumi::nextWorkingDay( 'Poland', new \DateTimeImmutable('2022-12-23') )->format( 'Y-m-d' ) );

    bug 
    opened by sebastianpisula 1
  • Certain holidays functions are now private

    Certain holidays functions are now private

    We're using your library in order to calculate the amount of working days from now to a specific date in the future.

    For this we need a relativly accurate decision if a day is a working day or not. The Germany-Provider does this pretty good, but we have a company policy that certains days (christmas eve and new years eve) are a holiday too. So Ive used your Germany-Provider and manually added both these dates using the ChristianHolidays-Provider via the methods $germany->addHoliday(christmasEve(..)) (same for NYE).

    In version 2.5 youve made these methods private - why?

    For the time being Ive copied the content of methods into my code - but thats not the way its supposed to be.

    Could you please do one of the following things?

    Solution 1: make these kinds of functions public If you'd made these kinds of functons public other providers / callers could re-use them and reduce the amount of copy-paste in the code. So I could add these holidays after the creation of the "base" provider Germany (or Saxony).

    Solution 2: make these kinds of function protected The "correct" way in terms of hierarchy would be to create a new provider inheriting from Saxony and add these holidays in the constructor. With christmasEve() being private to Germany I cant do that!

    I'd have to do this for every each Region-provider (e. g. a second subclass for Bavaria) ... thats why I prefer the first proposed solution!

    If you want I could provide PRs for both solutions, I'd prefer the first one though ;-)

    bug 
    opened by MatthiasKuehneEllerhold 8
Releases(2.5.0)
  • 2.5.0(Jan 30, 2022)

    It is that time again; the time for a new release!

    We have two more countries, and for a few countries new holidays are added, or regulations have been revised. Even more importantly, support for PHP 7.3 has been dropped, so all the more reason to upgrade to version 2.5.

    The documentation site has undergone a few changes, specifically to support readers with disabilities. And lastly, head over to GitHub Discussions to ask questions or share your ideas.

    Below you will find a summary of the most significant changes. For more details, please check the CHANGELOG file of this project or navigate to the v2.5 release blog post.

    Implemented Enhancements

    • Argentina Provider #264 (Nader Safadi).
    • Turkey Provider #250.
    • World Children's Day for Thuringia (Germany) #260.
    • New National Day for Truth and Reconciliation to Canada #257 (Owen V. Gray).
    • New Juneteenth National Independence Day to USA #253 (Mark Heintz).
    • The Korea Tourism Organization's holiday guide link was added to the source of South Korea Provider #255 (barami).
    • Mothering Day for the United Kingdom #266.
    • Revised rules to calculate substitution holidays of South Korea to apply the newly enacted law on June 2021 #255 (barami).
    • Separate calculateSubstituteHolidays method of South Korea Provider to calculateSubstituteHolidays and calculateOldSubstituteHolidays #255 (barami)
    • Refactored the tests of South Korea provider to testing substitution holidays #255 (barami).
    • Moved the United Kingdom Spring Bank Holiday to June 2nd and added Platinum Jubilee bank holiday on June 3rd for 2022 #270 (Dan).

    Resolved Issues

    • All Saints Day (German: 'AllerHeiligen') was classified as Other for states celebrating this day. This was incorrect (or officially changed) and has been altered to Official #263.
    • Corpus Christi (German: 'Fronleichnam') was classified as Other for states celebrating this day. This was incorrect (or officially changed) and has been altered to Official #252.
    • The test for the USA in that juneteenthDay was considered for all years: it is only celebrated since 2021.
    • Definition of Canada Day in Canada in that, Canada Day is July 1 if that day is not Sunday, and July 2 if July 1 is a Sunday #257 (Owen V. Gray).

    Removed

    • PHP7.3 Support as it is End of Life.
    Source code(tar.gz)
    Source code(zip)
  • 2.4.0(May 9, 2021)

    Yasumi v2.4 is a minor (maintenance) release which includes Georgia as a new Holiday Provider and several stability and bug fixes for issues discovered since v2.3.

    Below you will find a summary of the most significant changes. For more details, please check the CHANGELOG file of this project or navigate to the v2.4 release blog post.

    Implemented Enhancements

    • Georgia Provider #245 (Zurab Sardarov)
    • Pentecost (Sunday) to Germany #225 (Patrick Root)
    • Rescheduled exceptional Japanese holidays for Olympic Games 2020 after COVID-19 #240 (tanakahisateru)
    • Some improvements/refactoring of the Swiss holiday providers (including links to sources) #233 (Quentin Ligier)
    • Allow the WEEKEND_DATA constant in provider classes to be overridden. #235 (Mahmood Dhia)
    • Travis/StyleCI/Scrutinizer services replaced by Github Actions.
    • PHP8 Support #238 (Stéphane)
    • Added Infection PHP to perform mutation testing.
    • Added PHPStan to the dependencies allowing for local analysis.
    • Removed PHP 7.2 Support (PHP 7.2 is EOL)
    • Removed Faker library as it has been sunset #238 (Stéphane)
    • .gitattributes file to reduce the size of a release package #237 (Stéphane)

    Resolved Issues

    • The test for North West Territories (Canada) in that the National Indigenous Peoples Day was considered for all years: it is only celebrated since 1996.
    • The test for NovaScotia (Canada) in that novaScotiaHeritageDay was considered for all years: it is only celebrated since 2015.
    • The test for Ontario (Canada) in that IslanderDay was considered for all years: it is only celebrated since 2009.
    • The test for Marine Day (Japan) as the rescheduled day was moved to 2021 (due to the COVID-19 pandemic).
    • Typo for Estonian Day of Restoration of Independence #228 (Reijo Vosu)
    • The substitute holiday unit test as the use of the at() method will be deprecated in PHPUnit 10.
    • Incorrect invocation of Fribourg::calculateBerchtoldsTag() and Fribourg::calculateDecember26th (Switzerland)
    Source code(tar.gz)
    Source code(zip)
  • 2.3.0(Jun 22, 2020)

    You have probably seen the new documentation website already, and following I am pleased to announce a new release of Yasumi is available as of today for download or using your Composer configuration. Yasumi v2.3 is a minor release which brings two new providers to the pool (Canada and Luxembourg) and several important stability and bug fixes for issues discovered since v2.2.

    Below you will find a summary of the most significant changes. For more details, please check the CHANGELOG file of this project or navigate to the v2.3 release blog post.

    Implemented Enhancements

    • Added Canada Provider #215 (lux)
    • Added Luxembourg Provider #205 (Arkounay)
    • Holiday providers for states of Austria. #182 (aprog)
    • Added All Souls Day to Lithuania #227 (norkunas)
    • Catholic Christmas Day is a new official holiday since 2017 in the Ukraine. #202
    • Additional Dates for Australia/Victoria:AFL Grand Final Friday #190 (brucealdridge)
    • Substituted holidays (holidays that fall in the weekend) for Australia. #201 (c960657)
    • Added New Years Eve to Germany #226 (Patrick-Root)
    • Day of Liberation (Tag der Befreiung) is a one-time official holiday in 2020 in Berlin (Germany).
    • Catalan translations for holidays in Catalonia, Valencian Community, Balearic Islands and Aragon #189 (c960657)
    • Added American English spelling for Labour Day #216
    • Added French translation for Second Christmas Day #188 (Arkounay)
    • Renamed the Australian states to be full names instead of abbreviations to be in line with other Holiday Providers #214
    • Statehood Day is celebrated at a new date since 2020 in Croatia. #203 (krukru)
    • Independence Day is no longer an official holiday since 2020 in Croatia. #203 (krukru)
    • Homeland Thanksgiving Day has been renamed to "Victory and Homeland Thanksgiving Day and the Day of Croatian Defenders" since 2020 in Croatia. #203 (krukru)
    • Remembrance Day for Homeland War Victims and Remembrance Day for the Victims of Vukovar and Skabrnja is a new official holiday since 2020 in Croatia. #203 (krukru)
    • Second International Workers Day in Ukraine was an official holiday only until 2018. #202
    • Holiday names in Danish, Dutch, and Norwegian are no longer capitalized. #185 (c960657)

    Resolved Issues

    • Fixed Ukraine holidays on weekends. These days need to be substituted. #202
    • Fixed issue if the next working day happens to be in the next year (i.e. not in the year of the Yasumi instance) #192 (tniemann)
    • Fix locale fallback for substitute holidays #180 (c960657)
    • Fixed issue if the previous working day happens to be in the previous year (i.e. not in the year of the Yasumi instance)
    • Fixed compound conditions that are always true by simplifying the condition steps.
    Source code(tar.gz)
    Source code(zip)
  • 2.2.0(Oct 6, 2019)

    With the summer having come to an end, you may feel reinvigorated to give your PHP project(s) a clean up. And why not upgrade Yasumi to the next version while you are at it? Because from today v2.2 is officially available!

    Below you will find a summary of the most significant changes. For more details, please check the CHANGELOG file of this project or navigate to the v2.2 release blog post.

    Implemented enhancements

    • Holiday providers for England, Wales, Scotland and Northern Ireland #166 (c960657)
    • Holiday Provider for South Korea. #156 (blood72)
    • Translation for the Easter holiday for the 'fr_FR' locale #146 (pioc92)
    • Translation for the Pentecost holiday for the 'fr_FR' locale #145 (pioc92)
    • Late Summer Bank Holiday in United Kingdom prior to 1965 #161 (c960657)
    • Observance holidays for Sweden #172 (c960657)
    • Updated the translation for the All Saints holiday for the 'fr_FR' locale #152 (pioc92)
    • Updated the translation for the Armistice holiday for the 'fr_FR' locale #154 (pioc92)
    • Updated the translation for the Victory in Europe holiday for the 'fr_FR' locale #153 (pioc92)
    • Updated the translation for the Assumption of Mary holiday for the 'fr_FR' locale #155 (pioc92)
    • Updated the translation for Christmas Day for the 'nl_NL' locale #160 (pioc92)

    Resolved issues

    • Late Summer Bank Holiday in 1968 and 1969 in United Kingdom #161 (c960657)
    • Fixed one-off exceptions for May Day Bank Holiday in 1995 and 2020 and Spring Bank Holiday in 2002 and 2012 (United Kingdom) #160 (c960657)
    • Fixed revoked holidays in Portugal in 2013-2015 #163 (c960657)
    • Fixed spelling issues in the Danish translation for Second Christmas Day. #167 (c960657)
    • Corpus Christi is official in Poland #168 (c960657)
    • Liberation Day is official in the Netherlands #169 (c960657)
    • Typos in Easter Monday and Republic Day for the 'it_IT' locale #171 (c960657)
    • Good Friday is not official in Brazil #174 (c960657)
    Source code(tar.gz)
    Source code(zip)
  • 2.1.0(Mar 29, 2019)

    A couple of months after the successful v2 release, a new minor release is available as of today. Yasumi v2.1 addresses mostly a few issues for the Japan Holiday Provider and some other bug fixes.

    Implemented enhancements

    • As the Japanese Emperor will abdicate the throne on May 1st 2019, the holiday of the Emporers Birthday will change to February 23rd from 2020 (No holiday in 2019). In addition, Coronation Day and the Enthronement Proclamation Ceremony will be extra holidays in 2019. #130 (cookie-maker)
    • International Women's Day is an official holiday since 2019 in Berlin (Germany). #133 (huehnerhose)

    Resolved issues

    • Japanese Health And Sports Day will be renamed to Sports Day from 2020. #129 (cookie-maker)
    • Dutch spelling for Easter/Pentecost/Christmas to use lower case. #128 (c960657)
    • Refactored the Netherlands Holiday provider by moving the calculation of individual holidays to private methods. This will reduce the complexity of the initialize method.
    • Visibility of internal class functions to 'private'. These are to be used within the class only and should not be public.
    • "Bridge Day" for Japan takes two days in 2019. Currently the code only allows for 1 bridge day at a maximum. #141 (cookie-maker)
    • Tests for Bremen, Lower Saxony and Schleswig Holstein (Germany) also celebrated Reformation Day in 2017. The unit tests were failing as it didn't account for that.
    • Changed the USA Provider to check all holidays for potential substitute holidays, not just New Year's Day, Independence Day, and Christmas Day. #140 (jagers)
    • Adjusted tests for the 'next' and 'previous' methods to avoid actually exceeding the year boundaries.
    • Deprecation warning for the package mikey179/vfStream. Composer 2.0 requires package names to not contain any upper case characters. #135 (IceShack)
    • Incorrect comment about weekends in India #126 (c960657)
    • Correction to the test of New Year's day in the United Kingdom. It has been identified as a Bank Holiday only since 1975 (not from 1974).
    • Duplicate definition of newYearsDay #125 (c960657)
    Source code(tar.gz)
    Source code(zip)
  • 2.0.0(Jan 11, 2019)

    Almost a year has passed since the release of v1.8.0, but finally it is here: Yasumi v2.0.0!

    Upgraded entirely to PHP version 7 with PHP 7.1 being the minimum required version. Base code and all unit tests have been reworked to compatibility with PHP 7. This also means support of PHP 5 has now come to an end.

    More details can be found in the blog entry here: Welcome Yasumi version 2!

    Implemented enhancements:

    • New filter to select holidays that happen on a given date #119 (cruxicheiros)
    • Holiday Providers for all Australian states and territories. #112 (Milamber33)
    • Holiday Provider for Bosnia. #94 (TheAdnan)
    • Added Reformation Day as offical holiday since 2018 in Lower Saxony (Germany). #115 (Taxcamp)
    • Added Reformation Day as offical holiday since 2018 in Schleswig-Holstein (Germany). #106 (HenningCash)
    • Added Reformation Day as offical holiday since 2018 in Hamburg (Germany). #108 (HenningCash)
    • Added Reformation Day as offical holiday since 2018 in Bremen (Germany). #116 (TalonTR)
    • The (observed) holidays Lukkeloven, Constitution Day, New Year's Eve and Labour Day, as well as summertime and wintertime are included for Denmark #104 (c960657)
    • Upgraded to PHPUnit to version 7.5.
    • Changed Japanese holiday for the 2020 Olympic Games. Marine Day, Mountain Day and Health And Sports Day. #113 (cookie-maker)
    • Summer/winter time is now fetched from PHP's tz database. #103 (c960657)
    • Changed translation for Norway's national day. #98 (c960657)
    • Applied proper null checks in the summertime and wintertime calculations for Denmark and The Netherlands.
    • Corrected some namespaces for Australia and Germany.
    • Updated copyright year.
    • Upgraded various dependency packages.
    • Internal locale list updated based on CLDR v34.
    • Refactored the Japan and USA Holiday Provider by moving the holiday calculations to private methods. This reduced the complexity of the initialize method.

    Resolved issues

    • Translation for Russia showed in English (except New Year's Day) as the proper locale was not in place.
    • Fixed issue for summertime in Denmark in 1980. By default summertime in Denmark is set for the last day of March since 1980, however in 1980 itself, it started on April, 6th.
    • Fixed spelling issue in the Swedish translation. #97 (c960657)
    • Fixed spelling issues in the Danish translation. #96 (c960657)
    • Fixed German Easter Sunday and Pentecost Sunday holidays (not nationwide, only in Brandenburg). #100 (TalonTR)
    • Fixed BetweenFilter to ignore time part and timezone. #101 (c960657)
    • Fixed bug in provider list generation related to variable order of files returned by the filesystem #107 (leafnode)
    Source code(tar.gz)
    Source code(zip)
  • 1.8.1(Jan 11, 2019)

    Yasumi version 2.0 has been released (and v1.8.1)!

    With the release of Yasumi v2.0.0 supporting only PHP version 7.1 (or higher), support for PHP 5 in Yasumi has ended (Sorry!).

    This 1.8.1 bug fix release has been made available for those that still are on PHP 5 (or are in the process of upgrading to PHP 7). It only includes some serious/critical bug fixes discovered since version 1.8.0 and no new countries have been added for example.

    Please be aware that all new development will be done from v2.0.0 onwards (in the 'develop' branch). The 'support/1.8.x' branch has been created for critical bug fixes only.

    Changes

    • Added PHP 7.2 and 7.3 to the TravisCI configuration.
    • Changed Japanese holiday for the 2020 Olympic Games. Marine Day, Mountain Day and Health And Sports Day. #113
    • Changed translation for Norway's national day. #98

    Resolved issues

    • Except New Years Day, all holidays for Russia didn't have the locale parameter in place, causing Yasumi to use the fallback locale ('en_US').
    • Fixed spelling issue in the Swedish translation. #97
    • Fixed spelling issues in the Danish translation. #96
    • Fixed German Easter Sunday and Pentecost Sunday holidays (not nationwide, only in Brandenburg). #100
    • Fixed BetweenFilter to ignore time part and timezone. #101
    • Fixed bug in provider list generation related to variable order of files returned by the filesystem #107
    • Fixed issues that assertNotHoliday() skips rest of test
    • Type cast to integer as Yasumi::create() requires an integer.
    • Changed access to static variables with 'self'. Accessing with 'static' can lead to possible sub-classes.
    • Corrected date parameter to be of DateTime (instead of DateTimeInterface) as the parameter object needs to be a direct instance.
    • Changed way to get current year so value is an integer (as required by the class). PHP's date function is intended for formatting and returns a string type as such.
    • Corrected test using different start year to avoid incorrect assertion.
    Source code(tar.gz)
    Source code(zip)
  • 1.8.0(Feb 21, 2018)

    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 that 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.

    Implemented enhancements:

    • Added a function that can remove a holiday from the holidays providers (i.e. country/state) list of holidays. This function can be helpful in cases where an existing holiday provider class can be extended but some holidays are not part of the original (extended) provider.
    • Changed various functions that have a date parameter to support now objects implementing the DateTimeInterface and objects of the DateTimeImmutable type.
    • Added support for countries where the weekend definition (start and end day) differs from the global definition (Saturday and Sunday).
    • Holiday Provider for Russia. #72 (lukosius)
    • Holiday Provider for Estonia. #71 (lukosius)
    • Added Scrutinizer integration.
    • Locale List updated based on CLDR version 32.
    • Added PHPStan static analysis tool to Travis CI #88 (lukosius)
    • Various inline documentation enhancements. #87 (lukosius)
    • Removed unnecessary typecasts and if-construct. #87 (lukosius)
    • Updated inline documentation to include correction Exception throws.
    • Removed unnecessary NULL checks.

    Resolved Issues:

    • Fixed Brazilian Carnaval Day and added Ash Wednesday to Brazilian Holidays. #92 (glauberm)
    • Yasumi listed 01.04.2018 (Easter Sunday) for Spain as an official holiday, however it is not recognized as such. Fix made that recognizes Easter Sunday as being observed (in all regions). #86 (Bastian Konetzny)
    • Corrected reference to the Holiday Provider's ID to be static.
    • Changed weekend data property into constant as it is not dynamic (runtime).
    • Corrected the name translation test for the Restoration of Independence Day (Portugal). The test didn't account for the fact that this holiday was abolished and reinstated at some time.
    • Corrected unit test for Geneva (Switzerland) as the jeune Genevois day was incorrectly asserted as a regional holiday.
    • Corrected the count logic so that in case a holiday is substituted (or observed), it is only counted once.
    • Dropped unnecessary arguments of some methods in various Holiday Providers.
    • Corrected Japanese "Green Day" and "Children's Day" to use "Hiragana" instead of Kanji. #80 (cookie-maker)
    Source code(tar.gz)
    Source code(zip)
  • 1.7.0(Dec 11, 2017)

    A new release was long overdue and v1.7.0 has some nice enhancements... Four new countries have been added (Latvia, Lithuania, Hungary and Switzerland) making the total of holiday providers 96! (31 countries and 65 sub-regions).

    Instead of giving the country name as a parameter, you can now also use the ISO3166_2 code to instantiate a Holiday object, which in some cases makes more sense. Also, all filters implement the Countable interface so you can use the ->count() method, which will return the correct number of (filtered) holidays.

    Heads up! v1.7.0 will be the last release supporting PHP5.x. PHP7 has been out for a long time and Yasumi can definitely benefit from the new features in PHP7. Likely the PHP7 only branch will start as v2.0.0.

    As always a big thanks to all the contributors!

    Implemented enhancements:

    • Holiday Provider for Latvia. #70 (lukosius)
    • Holiday Provider for Lithuania. #67 (lukosius)
    • Holiday Provider for Hungary. #57 (AronNovak)
    • Holiday Provider for Switzerland. #56 (qligier)
    • All filters implement the Countable interface allowing you to use the ->count() method. #77
    • Sometimes it is more convenient to be able to create a Yasumi instance by ISO3166 code rather than Yasumi's Holiday Provider name. A new function createByISO3166_2 has been added to allow for that. #62 (huehnerhose)
    • Missing translations (de_DE) for Easter Sunday and Whitsunday. #60 (IceShack)
    • Made calculate method public and use of proper camel casing. #73 (patrickreck)
    • Upgraded Faker Library to version 1.7
    • Renamed the holiday type NATIONAL to OFFICIAL. Subregions may have official holidays and the name NATIONAL doesn't suit these situations. #65
    • Upgraded PHP-CS-Fixer to version 2.6

    Resolved Issues:

    • Corrected Geneva (Switzerland) unit test to ensure some holidays that are established at a particular year are handled as such.
    • Repentance Day is an official holiday in Saxony (Germany) #63
    • Corrected the Easter Sunday translation for Austria (de_AT) #66
    • Corrected Hungary unit test to ensure holidays that are established at a particular year are handled as such.
    • Added missing Summer Bank Holiday for the United Kingdom. #64
    Source code(tar.gz)
    Source code(zip)
  • 1.6.1(Feb 7, 2017)

    This bugfix release addresses some minor annoying issues, so unfortunately no new features this time.

    Implemented enhancements:

    • Moved Reformation Day to Christian Holidays as it is not only celebrated in Germany.
    • Added missing unit tests for the German Unit Day for each German state.

    Resolved issues:

    • Fixed Christmas Day and Boxing Day for the United Kingdom. A substitute bank holiday is now created for both Christmas and Boxing Day when either of those days fall on a weekend. #48 (joshuabaker)
    • Renamed 'en_US' translation for the Second Christmas Day (from ‘Boxing Day’ to ‘Second Christmas Day’: Boxing Day concept does not exist in the US). #53 (AngelinCalu)
    • Created fallback calculation of the easter_days function in case the PHP extension 'calendar' is not loaded. #55 (stelgenhof)
    • Added missing unit tests for Reformation Day as in 2017 it is celebrated in all German states for its 500th anniversary.
    • Changed Travis configuration to use Composer-installed phpunit to avoid if any issues arise with globally installed phpunit.
    Source code(tar.gz)
    Source code(zip)
  • 1.6.0(Jan 6, 2017)

    We start the new year with a new release, in which we welcome Austria, Ireland, Romania and South Africa to the Yasumi family. Also Yasumi hit the 8000 mark in the first week of 2017: over 8000 times Yasumi has been installed already!

    Again, thank you all for your contributions and fixes!

    Implemented enhancements:

    • Added Holiday Provider for Romania. #52 (AngelinCalu)
    • Added Holiday Provider for Ireland. stelgenhof
    • Added Holiday Provider for South Africa. stelgenhof
    • Added Holiday Provider for Austria. stelgenhof
    • Refactored the calculation of Orthodox Easter using the function from ChristianHolidays.php. #47 (AngelinCalu)
    • Added 'en_US' translations for the Polish Independence Day and Constitution Day. #45 (AngelinCalu)

    Resolved issues:

    • The parameters of the isHoliday and isWorkingDay methods now allow for classes that derive from DateTime (like the very popular Carbon class). #49 (stelgenhof)
    Source code(tar.gz)
    Source code(zip)
  • 1.5.0(Nov 25, 2016)

    Being occupied with other projects is good but has the side effect some others don't get the attention they deserve (sorry Yasumi). However, happy to announce a new release of Yasumi with 4 new countries added and holiday providers for all the German states.

    Yasumi now supports 62 holiday providers (23 countries and 39 sub-regions) and has over 1500 unit tests ensuring all holidays are calculated correctly.

    Big thanks to all the contributors making Yasumi better and more complete!

    Implemented enhancements:

    • Added Holiday Provider for Australia (and the sub-region of Victoria). #38 (brucealdridge)
    • Added Holiday Provider for Portugal. #44 (rvelhote)
    • Added Holiday Provider for Ukraine. #41 (madmis)
    • Added Holiday Providers for all 16 German States. #34 (stelgenhof)
    • Added Holiday Provider for Croatia. #32 (karlomikus)
    • Possibility to retrieve the next or previous working day within a defined number of days from today #39 (brucealdridge)
    • You can now also use your own holiday providers in addition to the included holiday providers. A very helpful improvement if Yasumi does not include your provider (yet), but you want to use yours! #29 (navarr)

    Resolved issues:

    • Carnival Day in Brazil was incorrectly set to be 47 days after Easter. Carnival Day begins Friday before Ash Wednesday (51 days to Easter). #36 (icaroce)
    • All Saints Day for Finland was incorrectly set for November 1st. The correct date is Saturday between 31 Oct and 6 Nov, similar to Sweden. #43 (stelgenhof)
    Source code(tar.gz)
    Source code(zip)
  • 1.4.0(Jun 4, 2016)

    Implemented enhancements:

    • Added Holiday Provider for Brazil. #21 (dorianneto)
    • Added Holiday Provider for the Czech Republic. #26 (dfridrich)
    • Added Holiday Provider for the United Kingdom. #23
    • Add Welsh language (spoken in Wales, UK) translations for the holidays in the United Kingdom #25 (meigwilym)
    • All Holiday Provider must now implement a code that will identify it. Typically this is the ISO3166 code corresponding to the respective country or subregion. This can help for purposes such as translations or interfacing with other API's for example.
    • To determine a set of holidays between two dates you can now use the aptly named 'between()' method.

    Resolved issues:

    • Fixed an issue with the unit test for the 'getProviders' method failing on Windows. Hardcoded unix-style directory separators have been replaced by DIRECTORY_SEPARATOR. #30 (navarr)
    • Corrected a typo in the English translation for 敬老の日 (Japan) #22 (navarr)
    • Fixed issue that the unit tests in 'YasumiTest' (methods 'next' and 'previous') didn't cover the situations that the limits are exceeded. #28
    Source code(tar.gz)
    Source code(zip)
  • 1.3.0(May 2, 2016)

    Implemented enhancements:

    • Added Holiday Provider for Poland. #18 (mpdx)
    • Added Holiday Provider for New Zealand. #13 (badams)
    • Added Holiday Provider for Greece. #10 (sebdesign)
    • Added Holiday Provider for Germany. #9 (eaglefsd)
    • Added translations ('fr_FR', 'fr_BE') for Belgium National day #864d250 (R2c)
    • Sorted all translations in the translation files alphabetically (descending).
    • Added missing English ('en_US') translations for the Christian holidays 'Immaculate Conception', 'Maundy Thursday', 'St. Georges Day', 'St. John's Day', 'St. Josephs Day' and 'St. Stephens Day'.
    • Added Test Interface class to ensure the unit tests contain a some minimal assertions.
    • Refactoring and cleanup of all unit tests.

    Resolved issues:

    • Fixed issue for Sweden as All Saints Day was always calculated to be on November 1st. However the holiday has always been celebrated on a Saturday (between October 31 and November 6th).
    • Fixed the getProviders as it was not able to load Holiday Providers defined in (sub) regions #5879133 (R2c)
    • Fixed issue that it was possible for the AbstractProvider class to be loaded as a Holiday Provider #9678bc4 (R2c)
    • Corrected incorrect pathname reference *BaseTestCase.php files ("Test" -> "test).
    • Fixed issue for France as Good Friday and St. Stephens Day were defined as official holidays. These aren't national holidays and are only observed in the French departments Moselle, Bas-Rhin and Haut-Rhin. With this fix, these holidays have been removed from the France Holiday providers and new providers for the departments Moselle, Bas-Rhin and Haut-Rhin are added. #17 (R2c)
    • Updated locales list based on CLDR version 29. Removed locales of which the region identifier is not specified.
    • Fixed issue for Sweden as Midsummer's Day (st. Johns Day) was always calculated to be on June 24th. However the holiday has always been celebrated on a Saturday (between June 20 and June 26).
    • Fixed base test for some Spain/LaRioja as some holidays have been established only in a particular year, causing false failures in the unit tests.
    • Running php-cs-fixer fix . --level=psr2 generated a massive list of changes, and broke unit tests. Added a custom .php_cs config file to adhere to the PSR-2 Coding Standards and resolve this issue. In addition the php-cs-fixer command to has been added to composer to run the fixers and on the CI server (Travis), meaning PR’s will need to be PSR2 compliant before they can be merged. If any files do not pass, the build fails. #15 #16 (badams)
    • Accidentally the timezone for Norway was set to "Europe/Copenhagen". This has been corrected to "Europe/Oslo". #11 #12 (badams)
    • Fixed issue for Finland as Midsummer's Day (st. Johns Day) was always calculated to be on June 24th. However since 1955, the holiday has always been celebrated on a Saturday (between June 20 and June 26).
    Source code(tar.gz)
    Source code(zip)
  • 1.2.0(Apr 4, 2016)

    Implemented enhancements:

    • Added Holiday Provider for Denmark
    • Added Holiday Provider for Norway
    • Added Holiday Provider for Sweden
    • Added Holiday Provider for Finland
    • New function 'isWorkingDay' added that determines whether a date represents a working day or not. A working day is considered a date that is neither a holiday nor falls into the weekend.
    • Refactoring and cleanup of unit tests

    Closed issues:

    • The Vernal Equinox Day and Autumnal Equinox Day in Japan were excluded from having it substituted for another day in case these days would fall on the weekend.
    • Fixed tests for some holiday providers as some holidays have been established only in a particular year, causing false failures in the unit tests.
    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Mar 10, 2016)

    Implemented enhancements:

    • Added Spain Holiday Driver (including the autonomous communities Andalusia, Aragon, Asturias, Balearic Islands, Basque Country, Canary Islands, Cantabria, Castile and León, Castilla-La Mancha, Ceuta, Community of Madrid, Extremadura, Galicia, La Rioja, Melilla, Navarre, Region of Murcia, Valencian Community)
    • Added Corpus Christi, St. Joseph's Day, Maundy Thursday, St. George's Day, St. John's Day to the common Christian Holidays.
    • Updated some English, Italian, French and Dutch translations.
    • Created separate tests for holidays that are substituted on different days.
    • Moved all other holiday calculations in Netherlands and France to individual methods.
    • Allow for name spaced holiday providers.
    • Added test for translation of Ash Wednesday and Valentinesday in the Netherlands.
    • Added test to check whether all holidays for a Holiday Provider are defined by the respective provider class.
    • Removed support for PHP 5.4. Minimum version is now 5.5. PHP 7.0 is known to work however in Travis CI still allowed to fail

    Closed issues:

    • Fixed issue for Japan where substituted holidays had same date as the original holidays.
    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(Apr 21, 2015)

    Welcome to the first public version of Yasumi! Yasumi is an easy PHP library to help you calculate the dates and names of holidays and other special celebrations from various countries/states.

    Source code(tar.gz)
    Source code(zip)
Wordpress Plugin to show a small amount of events in an easy to use calender/schedule

Wordpress Plugin to show a small amount of events in an easy to use calender/schedule

Michael Burtscher 32 Feb 7, 2022
The missing PHP 5.3+ calendar management library.

CalendR CalendR is an Object Oriented Calendar management library on top of PHP5.3+ Date objects. You can use it to deal with all your needs about cal

Yohan Giarelli 462 Dec 30, 2022
This library helps PHP users to convert and using Jalali DateTime format

Easy Jalali for PHP V1.0.0 Jalali calendar converter for Persian users in Iran, Afghanistan and other countries that use Jalali calendar. Very thanks

Majid J 3 Mar 20, 2022
A standalone DateTime library originally based off of Carbon

CakePHP Chronos Chronos aims to be a drop-in replacement for nesbot/carbon. It focuses on providing immutable date/datetime objects. Immutable objects

CakePHP 1.3k Jan 1, 2023
A simple PHP API extension for DateTime.

Carbon An international PHP extension for DateTime. http://carbon.nesbot.com <?php use Carbon\Carbon; printf("Right now is %s", Carbon::now()->toDat

Brian Nesbitt 16k Dec 30, 2022
Parse, validate, manipulate, and display dates in PHP w/ i18n support. Inspired by moment.js

Support I am a dad now for the last 1,5 years and that clearly shows in being on time with merging PRs or pushing this package further. Time is the bi

Tino Ehrich 944 Dec 21, 2022
Date Manager PHP Class

Date Manager PHP Class Date Manager Version 1.0.0 PHP class for date management, for example converting solar date to gregorian date and vice versa. C

Alireza Tolouei 2 Dec 21, 2021
CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due

The PHP cron expression parser can parse a CRON expression, determine if it is due to run, calculate the next run date of the expression, and calculate the previous run date of the expression. You can calculate dates far into the future or past by skipping n number of matching dates.

Chris Tankersley 4.3k Jan 9, 2023
Parse and validate crontab expressions in PHP

Standard (V7) compliant crontab expression parser/validator with support for time zones; see "man 5 crontab" for possible expressions.

René Pollesch 42 Dec 14, 2022
iCal-creator for PHP - This package offers an abstraction layer for creating iCalendars files

This package offers an abstraction layer for creating iCalendars files. By using this PHP package, you can create *.ics files without the knowledge of the underling format. The output itself will follow RFC 5545 as good as possible.

Markus Poerschke 1k Dec 23, 2022
OfficeLife manages everything employees do in a company. From projects to holidays to 1 on 1s to ... 🚀

All-in-one software to manage the employee lifecycle Website • Docs • Demo What is OfficeLife If a company wants to have a complete 360 view of what’s

OfficeLife 628 Dec 30, 2022
Decorations for the site for the Christmas holidays.

Christmas Christmas decorations for Winter CMS sites. Installing Composer composer require webvpf/wn-christmas-plugin Features there is no interactio

null 2 May 24, 2022
What do developers do on holidays? Right! Yet another sudoku.

yasu This is a project that happened to obsess the contributors on a greek island in the summer of 2022: figure out how to generate and solve sudoku b

null 2 Sep 18, 2022
PHP package that provides functions for calculating mathematical statistics of numeric data

Statistics PHP package PHP package that provides functions for calculating mathematical statistics of numeric data. In this package I'm collecting som

Hi Folks! 289 Dec 27, 2022
PHP package that provides functions for calculating mathematical statistics of numeric data.

Statistics PHP package PHP package that provides functions for calculating mathematical statistics of numeric data. In this package I'm collecting som

Hi Folks! 290 Dec 29, 2022
A PHP package for calculating & tracking the Service Level Agreement completion timings

A PHP package for calculating & tracking the Service Level Agreement completion timings. Features ?? Easy schedule building ‼️ Defined breaches ?? Hol

Alex 26 Oct 5, 2022
Quick-and-dirty script for calculating cryptocurrency capital gains for tax purposes.

Software for calculating cryptocurrency capital gains for tax purposes. Calculation with LIFO method, developed with Italy in mind.

Cristian Livella 10 Oct 6, 2022
Image optimization / compression library. This library is able to optimize png, jpg and gif files in very easy and handy way. It uses optipng, pngquant, pngcrush, pngout, gifsicle, jpegoptim and jpegtran tools.

Image Optimizer This library is handy and very easy to use optimizer for image files. It uses optipng, pngquant, jpegoptim, svgo and few more librarie

Piotr Śliwa 879 Dec 30, 2022
Easy CI - Tools that make easy to setup CI.

Easy CI Tools that make easy to setup CI. Check git conflicts in CI Check TWIG and Latte templates for missing classes, non-existing static calls and

null 14 Dec 22, 2022
Easy to use utility functions for everyday PHP projects. This is a port of the Lodash JS library to PHP

Lodash-PHP Lodash-PHP is a port of the Lodash JS library to PHP. It is a set of easy to use utility functions for everyday PHP projects. Lodash-PHP tr

Lodash PHP 474 Dec 31, 2022