Business - A PHP library for date calculations in business hours
Recently, I released Business, a PHP library to perform business hours date and time calculations.
It can be used in various contexts where working (opening) hours or holidays are involved like bookings, payrolls or time sheets.
With this library you can easily determine booking dates, the number of business days within a given period or the next opening date of your shop.
To install the latest version with Composer, issue the following command
First, you need to configure a Business instance before starting to perform calculations.
Here is the list of the currently implemented operations.
within - Checks if a date is within business hours
timeline - Returns a timeline of business dates
Example: Get the number of business days between two dates.
As you can see, there are 20 business days during this period (Monday 1st and Tuesday 2nd June being holidays).
closest - Returns the closest business date from a given date
That's it for now!
If you want to suggest a new feature or report a bug, feel free to do it on the Github repository!