{"repo":"spatie/period","free":true,"listed":false,"github":"https://github.com/spatie/period","clone":"git clone https://github.com/spatie/period.git","description":"Complex period comparisons","language":"PHP","stars":1700,"topics":["date","time","period","calculations","schedule","calendar"],"license":"MIT","category":"productivity","readme_excerpt":"Complex period comparisons This package adds support for comparing multiple dates with each other. You can calculate the overlaps and differences between n-amount of periods, as well as some more basic comparisons between two periods. Periods can be constructed from any type of DateTime implementation, making this package compatible with custom DateTime implementations like Carbon (see cmixin/enhanced-period to convert directly from and to CarbonPeriod). Periods are always immutable, there's never the worry about your input dates being changed. Support us We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products. We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall. Installation You can install the package via composer: Usage Creating periods You're encouraged to create periods using their static constructor: You can manually construct a period, but you'll need to manually provide its precision and boundaries . Using Period::make , the default precision ( Precision::DAY() ) and default boundaries ( Boundaries::EXCLUDE NONE() ) are used. Before discussing the API provided by this package, it's important to understand both how precision and boundaries are used. Precision Date precision is of utmost importance if you want to reliably co","default_branch":null,"files":null,"tree":[],"storefront":"/r/spatie","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/spatie/period/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}