NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #1742 most downloaded on Packagist
A helper to query and format a set of opening hours
Last release 11 days ago
27 Sep 2026
Release timing varies
gaps range from 9 days to 1.1 years
Nearly every release is documented
notes for 57 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
63 releases · first in 2016
Report a 24:00 close on the next midnight by @SashaMIT in #283
Full Changelog: 4.2.2...4.2.3
One column per quarter.
Fix Time comparison to ignore metadata and date context by @Amunak in #281
Time::isSameOrBefore()Full Changelog: 4.2.1...4.2.2
Time::isSameOrBefore()Time::isBefore() and Time::isAfter() comparing metadata and date context instead of clock time onlyFix previousClose with custom timezone by @kylekatarnls in #276
Full Changelog: 4.2.0...4.2.1
Merge time ranges takes in to account the data field, by @jhorie in #269
Allow 'dateTimeClass' in mergeOverlappingRanges and createAndMerge* by @kylekatarnls in #267
Full Changelog: 4.1.2...4.1.3
Update implicit nullable by @michaelw85 in #265
Update implicit nullable by @michaelw85 in #264
Full Changelog: 4.1.0...4.1.1
Fix isAlwaysClosed and isAlwaysOpen when opening hours contain exceptions by @jordyvanderhaegen in #262
isAlwaysClosed and isAlwaysOpen when opening hours contain exceptions by @jordyvanderhaegen in #262Full Changelog: 4.0.3...4.1.0
Fix nextClose() result with overflow over night by @kylekatarnls in #259
nextClose() result with overflow over night by @kylekatarnls in #259Full Changelog: 4.0.2...4.0.3
Handle opening-time with the first minute of day only by @kylekatarnls in #256
Full Changelog: 4.0.1...4.0.2
Allow date without year in validFrom/validTo structured data
Full Changelog: 4.0.0...4.0.1
Replace getData() with readonly property ->data
getData() with readonly property ->dataisAlwaysOpen() and isAlwaysClosed() methodsDay to an enumTime and TimeRange readonlyOpeningHourscreateFromStructuredData()Add ranges support via to or - separator
Time::date() methodDateTimeRange classto or - separatorfill() and setData()setFilters()Cap holidays check to end date when calculating diff
Make comparison microsecond-precise
Apply timezone for all methods and both input/output
Copy non immutable dates to apply timezone
Add array-shape create() PHPDoc
- Fix compatibility with PHP 8.1
Add dateTimeClass option to use other class for date objects
Fix "hours" merge in mergeOverlappingRanges
Add "hours" key support in mergeOverlappingRanges
Use OpeningHours timezone for isOpenOn()
Allow isOpenOn() to take date string as parameter
isOpenOn() to take date string as parameter- Add Time::diff() methods
Time::diff() methodsFix support of data/filters/overflow with OpeningHours::createAndMergeOverlappingRanges() and OpeningHours::mergeOverlappingRanges()
OpeningHours::createAndMergeOverlappingRanges() and
OpeningHours::mergeOverlappingRanges()Added InvalidTimezone exception
InvalidTimezone exceptionAdded forWeekConsecutiveDays() method
forWeekConsecutiveDays() methodAllowed to retrieve current and previous opening hours
previousOpen()previousClose()currentOpenRange()currentOpenRangeStart()currentOpenRangeEnd()- Allowed #128 un-ordered ranges
Added #121 timezone supporrt in TimeRange::format()
TimeRange::format()Added #121 custom format and timezone support in asStructuredData()
asStructuredData()Fixed merge when last range of day ends with 24:00
24:00Fixed #115 return 24:00 when Time::fromString('24:00') is casted to string
24:00 when Time::fromString('24:00') is casted to stringAdded a MaximumLimitExceeded exception to prevent infinite loop
MaximumLimitExceeded 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).
⚠ 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()Fixed #111 overflow with simple ranges and add tests
Allowed opening hours overflowing on the next day by passing 'overflow' => true option in array definition
'overflow' => true option in array definitionFixed #98 Set precise time bounds
Fixed #95 Handle hours/data in any order
Fixed #88 Opening hours across Midnight
Nothing published for this version
Added support for immutable dates
setData() 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 tooNothing published for this version
Allowed to merge overlapping hours #43
Added start time to overspilling timeranges
- Added nextClose
nextCloseAdded additional helpers on Time
TimeAdded the ability to pass a DateTime instance to mutate to Time::toDateTime
DateTime instance to mutate to Time::toDateTimeAdded OpeningHours::forWeekCombined()
OpeningHours::forWeekCombined()Added the ability to add recurring exceptions
Fixed bug where checking on times starting at midnight would cause an infinite loop
Added regularClosingDays, regularClosingDaysISO and exceptionalClosingDates methods
regularClosingDays, regularClosingDaysISO and exceptionalClosingDates methodsAdded asStructuredData to retrieve the opening hours as a Schema.org structured data array
asStructuredData 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::empty- Added timezone support
- isClosedOn fix
isClosedOn fixFixed missing import in Time class
Time classReplaced DateTime by DateTimeInterface
DateTime by DateTimeInterface- First release
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →