maximnara/business-days-counter is a Laravel package for counts business days difference..
It currently has 2 GitHub stars and 2 downloads on Packagist (latest version 1.0.0).
Install it with composer require maximnara/business-days-counter.
Discover more Laravel packages by maximnara
or browse all Laravel packages to compare alternatives.
Last updated
Returns difference between dates without public holidays and weekends. Works for different countries.
Add library in Composer
composer require maximnara/business-days-counter
If you are developing this module you can connect this library locally.
"require": {
...,
"maximnara/business-days-counter": "*"
},
"repositories": [
...,
{
"type": "path",
"url": "../business-days-counter"
}
]
config/app.php into providers array:"providers" => array(
...,
ShowHeroes\LaravelQueueMonitoring\LaravelQueueMonitoringServiceProvider::class,
)
In your config/services.php set this
'business-days-counter' => [
'country' => 'lv',
'working-hours' => [
'from' => 9,
'to' => 18,
'launch-hour' => 14, // This is launch hour start and it goes till 15
],
],
use maximnara\BusinessDaysCounter\DatesCounter;
public function __construct(DatesCounter $datesCounter)
{
$this->datesCounter = $datesCounter;
}
public function action()
{
$diffInSeconds = $this->datesCounter->getDifferenceInSeconds($date1, $date2, DateCounter::COUNTRY_FR); // Here only Carbon dates.
}