krystianzybala / free-days
Simple Free Days library in PHP
Installs: 1 526
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Requires
- php: >=7.0.0
Requires (Dev)
- phpspec/phpspec: @stable
- phpunit/phpunit: @stable
- squizlabs/php_codesniffer: @stable
This package is not auto-updated.
Last update: 2018-09-25 10:04:42 UTC
README
FreeDays A simple php library which decides whether the passed day is a day off.
##Installation
Require new dev dependency using composer:
composer require "krystianzybala/free-days"
Using Proxy
If you want to use very quickly, use the proxy
<?php $dateTime = new \DateTime('04-01-2016'); if(false === FreeDaysMatcher::isFreeDay($dateTime, 'polish', $error)) { echo $error; //return message "04-01-2016 is not free day. Free day will be for 2 days" }
Using Factory
<?php use FreeDays\Factory\SimpleFactory; $factory = new SimpleFactory(); $assert = $factory->create(); $dateTime = new \DateTime('01-01-2016'); $assert->check($dateTime); //return true $assert->getError(); //null
Example usage
<?php use FreeDays\Factory\SimpleFactory; $factory = new SimpleFactory(); $assert = $factory->create(); $dateTime = new \DateTime('01-01-2016'); $assert->check($dateTime, 'polish'); //return true $assert->getError(); //null
Available free days object
- PolishFreeDays
New FreeDays Object
If you do not find your country, you can help prepare a new object for your country or you can prepare it yourself.
More information in CONTRIBUTING.md
License
This library is distributed under the MIT license. Please see the LICENSE file.
Feedback
If you want give me feedback, contact me kontakt@kzybala.pl