spatie/opening-hours
Define and query business opening hours with weekly schedules and exceptions. Check if a date/time is open or closed, get next open/close times, and format hours per day. Integrates with Carbon via cmixin/business-time for date-based queries.
getData() with readonly property ->dataTime::date() methodDateTimeRange classto or - separatorfill() and setData()setFilters()isOpenOn() to take date string as parameterTime::diff() methodsOpeningHours::createAndMergeOverlappingRanges() and
OpeningHours::mergeOverlappingRanges()InvalidTimezone exceptionforWeekConsecutiveDays() methodpreviousOpen()previousClose()currentOpenRange()currentOpenRangeStart()currentOpenRangeEnd()TimeRange::format()asStructuredData()24:0024:00 when Time::fromString('24:00') is casted to stringMaximumLimitExceeded exception to prevent infinite loop⚠ TimeRange no longer return true on containsTime for times overflowing next day. Overflow is now calculated at the day level (OpeningHoursForDay).
OpeningHoursForDay::isOpenAtNight()TimeRange::overflowsNextDay()'overflow' => true option in array definitionsetData() and getData()TimeRange::fromArray() and TimeRange::fromDefinition() (to support array of hours+data or string[] or string)setFilters() and getFilters()⚠ Breaking changes:
nextOpen() and nextClose() return type changed for DateTimeInterface as it can now return DateTimeImmutable tootoDateTime() changed both input type and return type for DateTimeInterface as it can now take and return DateTimeImmutable toonextCloseTimeDateTime instance to mutate to Time::toDateTimeOpeningHours::forWeekCombined()regularClosingDays, regularClosingDaysISO and exceptionalClosingDates methodsasStructuredData to retrieve the opening hours as a Schema.org structured data arraynextOpen method to determine the next time the business will be openOpeningHours::map, OpeningHours::flatMap, OpeningHours::mapExceptions, OpeningHours::flatMapExceptions,OpeningHoursForDay::map and OpeningHoursForDay::emptyisClosedOn fixTime classDateTime by DateTimeInterfaceHow can I help you explore Laravel packages today?