Download the PHP package rovangju/carbon-nbd without Composer
On this page you can find all versions of the php package rovangju/carbon-nbd. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rovangju/carbon-nbd
More information about rovangju/carbon-nbd
Files in rovangju/carbon-nbd
Package carbon-nbd
Short Description Carbon DateTime extension to calculate the "next business day"
License GPLv2
Informations about the package carbon-nbd
Carbon Wrapper: Next Business Day (NBD)
Have some business logic that requires a somewhat complicated calculation for deadlines or effective dates that need to be modified based on holidays, weekends or special dates? This wrapper for the PHP Carbon project (a DateTime extension itself) is for you!
Overview
The basic principal for this utility is to perform date based logic to determine the "next business day" for a provided date. There are various ways to layer in complexity to supplement holidays and deadlines.
The meat and potatoes functionality is provided by the nbd(Carbon $c)
method. The method will perform it's checking routine by checking the various criteria and incrementing the day by one in a loop. The nbd()
method will return an updated Carbon::
object with the date set to the appropriate business day.
Please note: This is for date logic only.
Basic usage
Callback support
Deadline support
Say you want to allow payments made today, before 3:00pm effective today. If the payment was submitted after 3:00pm, it is not effective until the next business day...
NOTE: Deadlines are ONLY effective based on hour logic; the date passed into setDeadline() is unregarded!
A more complete use case via extension...
Contributing
Please follow the Git Flow conventions. Proposals should be performed against develop or a feature/bugfix/support branch to be merged in by the maintainer.
Releases/versioning semantics follow the Semantic Versioning 2.0.x guidelines. Minute adjustments (e.g.: changes to this README.md) may or may not result in a new version tag, depending on the nature of the change.