2017 © Pedro Peláez
 

library holidays

Returns the holidays for a country

image

hansott/holidays

Returns the holidays for a country

  • Thursday, December 14, 2017
  • by hansott
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Holidays

Latest Version on Packagist ![Software License][ico-license] Build Status ![Coverage Status][ico-scrutinizer] Quality Score ![Total Downloads][ico-downloads], (*1)

Returns the holidays for a country., (*2)

Install

Via Composer, (*3)

``` bash $ composer require hansott/holidays, (*4)


## Supported countries and locales * Belgium (BEL) * be-nl Your country and/or locale not in the list? Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details. ## Usage ``` php use HansOtt\Holiday\Factory; use HansOtt\Holiday\Calendar\Year; $factory = Factory::create(); $calendar = $factory->getCalendar('BEL'); $translator = $factory->getTranslator('BEL', 'nl-be'); $year = Year::current(); // or $year = new Year(2016); $holidays = $calendar->getHolidays($year); foreach ($holidays as $holiday) { $name = $translator->getName($holiday); // string $startsAt = $holiday->beginsAt(); // DateTimeImmutable $endsAt = $holiday->endsAt(); // DateTimeImmutable $formattedTime = $startsAt->format('l j F Y'); // string echo sprintf('%s -> %s', $name, $formattedTime) . PHP_EOL; }

Output:, (*5)

Nieuwjaar -> Friday 1 January 2016
Paasmaandag -> Monday 28 March 2016
Feest Van De Arbeid -> Sunday 1 May 2016
Onze Lieve Heer Hemelvaart -> Monday 11 April 2016
Pinkstermaandag -> Wednesday 18 May 2016
Nationale Feestdag -> Thursday 21 July 2016
Onze Lieve Vrouw Hemelvaart -> Monday 15 August 2016
Allerheiligen -> Tuesday 1 November 2016
Wapenstilstand -> Friday 11 November 2016
Kerstmis -> Sunday 25 December 2016

Change log

Please see CHANGELOG for more information what has changed recently., (*6)

Testing

bash $ composer test, (*7)

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*8)

Security

If you discover any security related issues, please email hansott at hotmail be instead of using the issue tracker., (*9)

Credits

License

The MIT License (MIT). Please see License File for more information., (*10)

The Versions

14/12 2017

dev-master

9999999-dev https://github.com/hansott/holidays

Returns the holidays for a country

  Sources   Download

MIT

The Requires

  • php ~5.5|~7.0

 

The Development Requires

holidays hansott

23/07 2016

1.0.0

1.0.0.0 https://github.com/hansott/holidays

Returns the holidays for a country

  Sources   Download

MIT

The Requires

  • php ~5.5|~7.0

 

The Development Requires

holidays hansott