{"repo":"spatie/opening-hours","free":true,"listed":false,"github":"https://github.com/spatie/opening-hours","clone":"git clone https://github.com/spatie/opening-hours.git","description":"Query and format a set of opening hours","language":"PHP","stars":1721,"topics":["php","shop","opening-hours","schedule","calendar"],"license":"MIT","category":"productivity","readme_excerpt":"A helper to query and format a set of opening hours With spatie/opening-hours you create an object that describes a business' opening hours, which you can query for open or closed on days or specific dates, or use to present the times per day. spatie/opening-hours can be used directly on Carbon thanks to cmixin/business-time so you can benefit opening hours features directly on your enhanced date objects. A set of opening hours is created by passing in a regular schedule, and a list of exceptions. The object can be queried for a day in the week, which will return a result based on the regular schedule: It can also be queried for a specific date and time: It can also return arrays of opening hours for a week or a day: On construction, you can set a flag for overflowing times across days. For example, for a nightclub opens until 3am on Friday and Saturday: This allows the API to further at previous day's data to check if the opening hours are open from its time range. You can add data in definitions then retrieve them: In the example above, data are strings but it can be any kind of value. So you can embed multiple properties in an array. For structure convenience, the data-hours couple can be a fully-associative array, so the example above is strictly equivalent to the following: You can use the separator to to specify multiple days at once, for the week or for exceptions: The last structure tool is the filter, it allows you to pass closures (or callable function/method refere","default_branch":null,"files":null,"tree":[],"storefront":"/r/spatie","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/spatie/opening-hours/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."}