Skip to content

spaanproductions/laravel-carbon-holidays

Repository files navigation

Carbon isHoliday() function to check if the current date is a Holiday

Latest Version on Packagist Total Downloads GitHub Actions

This package can be used to add the isHoliday() function to Carbon. This only checks the Dutch holidays at the moment. We will only check if it's a holiday, not if it's a mandatory free day.

Installation

You can install the package via composer:

composer require spaanproductions/laravel-carbon-holidays

It will auto discover in Laravel.

Usage

use \Carbon\Carbon;

// NewYear
$date = Carbon::createFromDate(2021, 01, 01);
$date->isHoliday(); // true

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email info@spaanproductions.nl instead of using the issue tracker.

Credits

License

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

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.