All notable changes to opening-hours
will be documented in this file
- Replace
getData()
with readonly property->data
- Add
Time::date()
method - Add
DateTimeRange
class - Add ranges support via
to
or-
separator - Deprecate
fill()
andsetData()
- Remove
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
- Add
Time::diff()
methods
- Fix support of data/filters/overflow with
OpeningHours::createAndMergeOverlappingRanges()
andOpeningHours::mergeOverlappingRanges()
- Added
InvalidTimezone
exception
- Added
forWeekConsecutiveDays()
method
- Allowed to retrieve current and previous opening hours
- Added
previousOpen()
- Added
previousClose()
- Added
currentOpenRange()
- Added
currentOpenRangeStart()
- Added
currentOpenRangeEnd()
- Allowed #128 un-ordered ranges
- Added #121 timezone supporrt in
TimeRange::format()
- Added #121 custom format and timezone support in
asStructuredData()
- Fixed merge when last range of day ends with
24:00
- Fixed #115 return
24:00
whenTime::fromString('24:00')
is casted to string
- Added a
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).
- Added
OpeningHoursForDay::isOpenAtNight()
- Added
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
- Fixed #98 Set precise time bounds
- Fixed #95 Handle hours/data in any order
- Fixed #88 Opening hours across Midnight
- Fixed #89 Data support for next open hours
- Implemented #93 Enable PHP 8
- Added support for immutable dates
- Allowed to add meta-data to global/exceptions config, days config, ranges settings via
setData()
andgetData()
- Allowed dynamic opening hours settings
- Added
TimeRange::fromArray()
andTimeRange::fromDefinition()
(to support array of hours+data or string[] or string) - Added
setFilters()
andgetFilters()
⚠ Breaking changes:
nextOpen()
andnextClose()
return type changed forDateTimeInterface
as it can now returnDateTimeImmutable
tootoDateTime()
changed both input type and return type forDateTimeInterface
as it can now take and returnDateTimeImmutable
too
- Added start time to overspilling timeranges
- Added
nextClose
- Added additional helpers on
Time
- Added the ability to pass a
DateTime
instance to mutate toTime::toDateTime
- Added
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
andexceptionalClosingDates
methods
- Added
asStructuredData
to retrieve the opening hours as a Schema.org structured data array - Added
nextOpen
method to determine the next time the business will be open - Added utility methods:
OpeningHours::map
,OpeningHours::flatMap
,OpeningHours::mapExceptions
,OpeningHours::flatMapExceptions
,OpeningHoursForDay::map
andOpeningHoursForDay::empty
- Added timezone support
isClosedOn
fix
- Fixed missing import in
Time
class
- Replaced
DateTime
byDateTimeInterface
- First release