Release Notes
These are the release notes from Period. We’ve tried to cover all changes, including backward compatible breaks from 3.0 through to the current stable release. If we’ve missed anything, feel free to create an issue, or send a pull request.
version 5.3.2 - 2024-03-23
Added
- None
Fixed
- Fix package to avoid PHP8.4 deprecation warnings
Deprecated
- None
Removed
- None
version 5.3.1 - 2023-12-06
Added
- None
Fixed
Deprecated
- None
Removed
- None
version 5.3.0 - 2023-11-28
Added
Chart\LetterCase::convert
Fixed
- Handles gracefully new Date exception in PHP8.3
Deprecated
- None
Removed
- None
version 5.2.1 - 2023-02-25
Added
- None
Fixed
Period::fromRangeshould work in PHP8.1 withDatePeriodlimitations.
Deprecated
InitialDatePresenceuse insteadPeriod::fromRange
Removed
- None
version 5.2.0 - 2023-02-18
Added
Period::rangeForwardallows iteration over a set of dates and times, recurring at regular intervals, over the instance forward starting from the instance start.Period::rangeBackwardsAllows iteration over a set of dates and times, recurring at regular intervals, over the instance backwards starting from the instance ending.Period::fromRangereturns a newPeriodinstance from aDatePeriodobject. Only usable in PHP8.2+ installation
Fixed
- Using PHPUnit 10 instead of PHPUnit 9.
Deprecated
Period::dateRangeForwarduse insteadPeriod::rangeForwardPeriod::dateRangeBackwardsuse insteadPeriod::rangeBackwards
Removed
- None
version 5.1.0 - 2022-06-29
Added
DatePoint::fromFormatto instantiate from a date format and its related string.
Fixed
Period::fromIso8601now supports truncated date and duration in the interval string.
Deprecated
- None
Removed
- None
version 5.0.0 - 2022-02-22
Added
IntervalErrorused as the error interface marker.InvalidIntervalexception for anything regarding creating an object.Duration::fromSecondsuses a dedicated fraction parameter and the seconds are no longer expressed using afloatvalue.Period::fromTimestampto instantiate a time range object from two timestamps.Period::fromIso80000to instantiate a time range object from a mathematical representation and a date format.Period::fromBourbakito instantiate a time range object from a mathematical representation and a date format.Periodduration comparison methods accepts alsoDurationandDateIntervalin addition toPeriodobjects.Period::unionPeriod::snapTo*methods to ease period expansion.Period::meetsPeriod::meetsOnStartPeriod::meetsOnEndPeriod::toBourbakiPeriod::toIso80000Period::toBourbakiBoundsEnumeration.InitialDatePresenceEnumeration.Sequence::toListChart\LetterCaseEnumeration.Chart\AlignmentEnumeration.Chart\StreamOutputclass to replaceChart\ConsoleOutputclass.Chart\TerminalEnumeration.Chart\ChartErrorused as the chart error interface marker.Chart\UnableToDrawChartexception for anything regarding drawing a chart out ofPeriodand/orSequenceobjects.
Fixed
- Switch from using
Closureobject instead of thecallablepseudo type with theSequencemethods. Period::diffreturns aSequenceinstance instead of an array.Period::__constructis private.Periodnamed constructors, all parameters are required except for the boundaries.Period::timeDurationnow returns anintinstead of afloatvalue.Period::intersectnow can take multiplePeriodinstances as parameters.Period::subtractnow can take multiplePeriodinstances as parameters.Durationno longer extends aDateIntervalobject.Duration::fromIsoStringsupports 3 versions of dealing with fractions with ISO valid string.Datepointclass renamedDatePoint.DatePointno longer extends aDateTimeImmutableobject.- Argument names are normalized throughout the package. (PHP8 BC break)
Chart\LatinLetterin case of wrong value will fall back toAinstead of0which is not a letter.Chart\LatinLetterthe starting label must be explicit on instantiation.Chart\RomanNumberrequires its two arguments to be explicitly set.
Deprecated
- None
Removed
- Support for PHP7 and PHP8.0
Period::fromDatepointreplaced byPeriod::fromDatePeriod::getStartDatereplaced by accessing readonly propertyPeriod::startDatePeriod::getEndDatereplaced by accessing readonly propertyPeriod::endDatePeriod::getBoundaryTypereplaced by accessing readonly propertyPeriod::boundsPeriod::getDateIntervalreplaced byPeriod::dateIntervalPeriod::getTimestampIntervalreplaced byPeriod::timeDurationPeriod::withBoundaryTypereplaced byPeriod::boundedByPeriod::isStartIncludedwith no replacement useBounds::isStartIncludedPeriod::isStartExcludedwith no replacement useBounds::isStartIncludedinsteadPeriod::isEndIncludedwith no replacement useBounds::isEndIncludedPeriod::isEndExcludedwith no replacement useBounds::isEndIncludedinsteadPeriod::fromDatePeriodreplaced byPeriod::fromDateRangePeriod::getDatePeriodreplaced byPeriod::dateRangePeriod::getDatePeriodBackwardsreplaced byPeriod::dateRangeBackwardsPeriod::__stringreplaced byPeriod::toIso8601Period::formatreplaced byPeriod::toIso80000Period::splitreplaced byPeriod::splitForwardPeriod::substractusePeriod::subtractinsteadSequence::substractuseSequence::subtractinsteadSequence::getIntersectionsuseSequence::intersectionsinsteadSequence::getGapsuseSequence::gapsinsteadSequence::getBoundariesuseSequence::lengthinsteadSequence::getTotalTimestampIntervaluseSequence::totalTimeDurationinsteadSequence::toArrayuseSequence::toListinsteadDuration::__toStringandDuration::formatwith no replacementDuration::createis removed with no replacementDatepoint::createis removed with no replacement- The
createprefix is removed from theDurationandDatepointnamed constructors. - All charts related classes have their properties exposed as public readonly. All their getters are removed except if they are part of an interface.
Chart\ConsoleOutputreplaced byChart\StreamOutputclass.Chart\RomanNumber::isLoweruseChart\LetterCase::isUpperinstead.Chart\RomanNumber::startingAtuseChart\DecimalNumber::startLabelpublic readonly propertyChart\RomanNumber::startsWithis removed with no replacementChart\RomanNumber::withLetterCaseis removed with no replacementChart\DecimalNumber::startsWithis removed with no replacementChart\LatinNumber::startsWithis removed with no replacementChart\LatinNumber::startingAtuseChart\LatinNumber::startLabelpublic readonly propertyChart\AffixLabel::withPrefixis removed with no replacementChart\AffixLabel::withSuffixis removed with no replacementChart\AffixLabel::prefixmethod useChart\AffixLabel::labelPrefixpublic readonly propertyChart\AffixLabel::suffixmethod useChart\AffixLabel::labelSuffixpublic readonly property
Removed all the following namespaced functions from the package:
League\Period\datepointLeague\Period\durationLeague\Period\yearLeague\Period\semesterLeague\Period\quarterLeague\Period\monthLeague\Period\dayLeague\Period\hourLeague\Period\minuteLeague\Period\secondLeague\Period\instantLeague\Period\iso_yearLeague\Period\iso_weekLeague\Period\interval_afterLeague\Period\interval_beforeLeague\Period\interval_aroundLeague\Period\interval_from_dateperiod
version 4.12.0 - 2022-02-21
Added
Datepoint::secondDatepoint::minuteDatepoint::hourDatepoint::isoWeekDatepoint::monthDatepoint::quarterDatepoint::semesterDatepoint::yearDatepoint::isoYearDuration::fromDateIntervalDuration::fromSecondsDuration::fromChronoStringDuration::fromTimeStringDuration::fromDateStringPeriod::timeDurationPeriod::dateIntervalPeriod::dateRangeForwardPeriod::dateRangeBackwardsPeriod::toIso80000Period::splitForwardPeriod::timeDurationDiffPeriod::boundedBySequence::lengthSequence::totalTimeDuration
Fixed
- None
Deprecated
Datepoint::getSecondis deprecated in favor ofDatepoint::secondDatepoint::getMinuteis deprecated in favor ofDatepoint::minuteDatepoint::getHouris deprecated in favor ofDatepoint::hourDatepoint::getIsoWeekis deprecated in favor ofDatepoint::isoWeekDatepoint::getMonthis deprecated in favor ofDatepoint::monthDatepoint::getQuarteris deprecated in favor ofDatepoint::quarterDatepoint::getSemesteris deprecated in favor ofDatepoint::semesterDatepoint::getYearis deprecated in favor ofDatepoint::yearDatepoint::getIsoYearis deprecated in favor ofDatepoint::isoYearDuration::createfromDateIntervalis deprecated in favor ofDatepoint::fromDateIntervalDuration::createfromSecondsis deprecated in favor ofDatepoint::fromSecondsDuration::createfromChronoStringis deprecated in favor ofDatepoint::fromChronoStringDuration::createfromTimeStringis deprecated in favor ofDatepoint::fromTimeStringDuration::createfromDateStringis deprecated in favor ofDatepoint::fromDateStringPeriod::getTimestampIntervalis deprecated in favor ofPeriod::timeDurationPeriod::getDateIntervalis deprecated in favor ofPeriod::dateIntervalPeriod::getDatePeriodis deprecated in favor ofPeriod::dateRangeForwardPeriod::getDatePeriodBackwardsis deprecated in favor ofPeriod::dateRangeBackwardsPeriod::formatis deprecated in favor ofPeriod::toIso80000Period::splitis deprecated in favor ofPeriod::splitForwardPeriod::withBoundaryTypeis deprecated in favor ofPeriod::boundedByPeriod::timestampIntervalDiffis deprecated in favor ofPeriod::timeDurationDiffSequence::boundariesis deprecated in favor ofSequence::lengthSequence::getTotalTimestampIntervalis deprecated in favor ofSequence::totalTimeDuration
Removed
- None
version 4.11.0 - 2020-11-11
Added
Period::fromDatepointDuration::createFromDateIntervalDuration::createFromTimeStringDuration::createFromChronoStringDuration::createFromSecondsDuration::createsupports DateInterval spec strings.- Support for PHP8
Fixed
Duration::createwhen using a float will now overflow the results up to the Hour unit.
Deprecated
- None
Removed
- None
version 4.10.0 - 2020-03-22
Added
Period::toIso8601- Charts featuring ported from Bakame\Period\Vizualizer
Fixed
- Fix issue with
Sequence::intersectionsmethod.
Deprecated
Period::__stringreplaced byPeriod::toIso8601
Removed
- Support for PHP7.1
version 4.9.0 - 2019-09-02
Added
$boundaryTypeargument added to the following named constructors:Period::fromDayPeriod::fromIsoWeekPeriod::fromMonthPeriod::fromQuarterPeriod::fromSemesterPeriod::fromYearPeriod::fromIsoYear
Period::subtractSequence::subtract
Fixed
- None
Deprecated
Period::substractusePeriod::subtractinsteadSequence::substractuseSequence::subtractinstead
Removed
- None
version 4.8.1 - 2019-07-16
Added
- None
Fixed
Sequencenegative offsets for a object with only onePeriodinstance issue #85
Deprecated
- None
Removed
- None
version 4.8.0 - 2019-06-20
Added
Datepointmethods returningPeriodobjects supports boundaryTypePeriod::mergesupports empty arguments.Sequence::containssupports empty arguments.Sequence::unshiftsupports empty arguments.Sequence::pushsupports empty arguments.Sequenceclass supports negative offsets.
Fixed
Duration::adjustedTono longer comparesDateIntervalobjects to be compatible with PHP7.4+
Deprecated
- None
Removed
- None
version 4.7.1 - 2019-05-19
Added
- None
Fixed
- Improve
Duration::createFromDateStringbug fix to take into account DateInterval::createFromDateString bug fix - Update the development tools to Infection 0.13
Deprecated
- None
Removed
- None
version 4.7.0 - 2019-03-31
Added
Sequence::getTotalTimestampIntervalsee PR #79Period::substractsee PR #80Sequence::substractsee PR #81
Fixed
- Update
Duration::createFromDateStringto take into account DateInterval::createFromDateString bug fix - Update the development tools to PHPUnit8.0 and PHPstan 0.11
Deprecated
- None
Removed
- None
version 4.6.0 - 2019-03-06
Added
Duration::adjustedTo- Internals: added support for PHP7.4 and PHP8.0 in travis.yml
Fixed
- None
Deprecated
Duration::withoutCarryOveruseDuration::adjustedToinstead
Removed
- None
version 4.5.0 - 2019-02-03
Added
Datepoint::isBeforeDatepoint::bordersOnStartDatepoint::isStartingDatepoint::isDuringDatepoint::isEndingDatepoint::bordersOnEndDatepoint::isAfterDatepoint::abutsDuration::createnow supports chronometer formatDuration::withoutCarryOver
Fixed
Period::durationCompareto take into account Timezone and DST
Deprecated
Duration::__toStringuseDuration::formatinstead
Removed
- None
version 4.4.0 - 2019-01-20
Added
- Added support for the boundary type
Period::EXCLUDE_START_INCLUDE_ENDPeriod::INCLUDE_START_EXCLUDE_ENDPeriod::EXCLUDE_ALLPeriod::INCLUDE_ALLPeriod::getBoundaryTypePeriod::isStartExcludedPeriod::isStartIncludedPeriod::isEndExcludedPeriod::isEndIncludedPeriod::withBoundaryTypePeriod::__constructadds the$boundaryTypeargument;Period::afteradds the$boundaryTypeargument;Period::beforeadds the$boundaryTypeargument;Period::aroundadds the$boundaryTypeargument;Period::fromDatePeriodadds the$boundaryTypeargument;
- Added missing Allen’s Algebra intervals
Period::bordersOnStartPeriod::bordersOnEndPeriod::isDuringPeriod::isStartedByPeriod::isEndedBy
- Added additional methods to the Sequence class
Sequence::unionsSequence::intersectionsSequence::gapsSequence::boundariesSequence::reduce
Fixed
- None
Deprecated
Sequence::getIntersectionsuseSequence::intersectionsinsteadSequence::getGapsuseSequence::gapsinsteadSequence::getBoundariesuseSequence::boundariesinstead
Removed
- None
version 4.3.1 - 2019-01-07
Added
- None
Fixed
Datepoint::createFromFormatsee issue #72
Deprecated
- None
Removed
- None
version 4.3.0 - 2018-12-21
Added
Sequenceimplements theArrayAccessinterface
Fixed
Sequence::mapmust preserve offset index after modification.
Deprecated
- None
Removed
- None
version 4.2.0 - 2018-12-19
Added
League\Period\DatepointLeague\Period\DurationPeriod::fromIsoYearPeriod::fromYearPeriod::fromSemesterPeriod::fromQuarterPeriod::fromMonthPeriod::fromIsoWeekPeriod::fromDayPeriod::afterPeriod::beforePeriod::aroundPeriod::fromDatePeriodSequence::map
Fixed
- None
Deprecated
League\Period\datepointLeague\Period\durationLeague\Period\yearLeague\Period\semesterLeague\Period\quarterLeague\Period\monthLeague\Period\dayLeague\Period\hourLeague\Period\minuteLeague\Period\secondLeague\Period\instantLeague\Period\iso_yearLeague\Period\iso_weekLeague\Period\interval_afterLeague\Period\interval_beforeLeague\Period\interval_aroundLeague\Period\interval_from_dateperiod
Removed
- None
version 4.1.0 - 2018-12-07
Added
League\Period\SequenceLeague\Period\InvalidIndex
Fixed
- None
Deprecated
- None
Removed
- None
version 4.0.1 - 2018-11-30
Added
- None
Fixed
- Period::split does not work with daylight saving see issue #68
Deprecated
- None
Removed
- None
version 4.0.0 - 2018-10-18
Added
Classes
Exceptionclass
Methods
Period::durationComparePeriod::durationEqualsPeriod::formatPeriod::expandPeriod::equalsPeriod::getDatePeriodBackwards
Functions
League\Period\datepointLeague\Period\durationLeague\Period\yearLeague\Period\semesterLeague\Period\quarterLeague\Period\monthLeague\Period\dayLeague\Period\hourLeague\Period\minuteLeague\Period\secondLeague\Period\instantLeague\Period\iso_yearLeague\Period\iso_weekLeague\Period\interval_afterLeague\Period\interval_beforeLeague\Period\interval_aroundLeague\Period\interval_from_dateperiod
Fixed
- The
Periodclass is now final Period::JsonSerializenow returns datepoint in JavaScript compatible notationPeriod::diffalways returns an array containing two values.- An instance with a duration equals to
DateInterval('PT0S')will contains no datepoint not even its starting datepoint.
Deprecated
- None
Removed
- Support for PHP
7.0 Period::nextPeriod::previousPeriod::addPeriod::subPeriod::createFromYearreplaced byLeague\Period\yearPeriod::createFromMonthreplaced byLeague\Period\monthPeriod::createFromWeekreplaced byLeague\Period\iso_weekPeriod::createFromDayreplaced byLeague\Period\dayPeriod::createFromSemesterreplaced byLeague\Period\semesterPeriod::createFromQuarterreplaced byLeague\Period\quarterPeriod::createFromDurationreplaced byLeague\Period\interval_afterPeriod::createFromDurationBeforeEndreplaced byLeague\Period\interval_beforePeriod::sameValueAsreplaced byPeriod::equalsPeriod::sameDurationAsreplaced byPeriod::durationEqualsPeriod::compareDurationreplaced byPeriod::durationComparePeriod::withDurationreplaced byPeriod::withDurationAfterStart
version 3.4.0 - 2017-11-17
Added
Period::withDurationBeforeEndPeriod::splitBackwards
Fixed
- None
Deprecated
- None
Removed
- dropped support for HHVM
version 3.3.0 - 2016-09-19
Added
Period::movesee Pull Request #40Period::moveStartDatesee Pull Request #42Period::moveEndDatesee Pull Request #42
Fixed
- None
Deprecated
Period::addyou should usePeriod::moveEndDateinstead see Pull Request #42Period::subyou should usePeriod::moveEndDateinstead see Pull Request #42
Removed
- None
version 3.2.0 - 2016-05-09
Added
Period::__set_state- autoloader to use the library without composer
Fixed
Deprecated
- None
Removed
- None
version 3.1.1 - 2016-02-12
Added
- None
Fixed
Period::containssee issue #31- microseconds are taken into account when converting
DateTimeInterfaceobjects.
Deprecated
- None
Removed
- None
version 3.1.0 - 2016-02-01
Added
Period::createFromDay
Fixed
Period::getDatePeriodadding the$optionparameterDateTimetoDateTimeImmutableconvertion improved for PHP 5.6+ version- Bumped version requirement to PHP 5.5.9 because of a bug in
DatePeriodconstructor
Deprecated
- None
Removed
- None
version 3.0.1 - 2015-12-22
Added
- None
Fixed
Period::containssee issue #28
Deprecated
- None
Removed
- None
version 3.0.0 - 2015-09-02
Added
Periodimplements theJsonSerializableinterfacePeriodcan now be extended
Fixed
Periodalways returnsDateTimeImmutableobjectsPeriod::splitreturns aGeneratorPeriod::mergeno longer throwsRuntimeException
Deprecated
- None
Removed
- support for PHP 5.4
Period::getStartPeriod::getEndPeriod::getRangePeriod::durationPeriod::durationDiff
version 2.5.1 - 2015-03-06
Fixed
Periodalways returnsDateTimeobjects even when givenDateTimeImmutableobjects.
version 2.5.0 - 2015-03-06
Added
Period::splitto split aPeriodobject into smallerPeriodobjects #16
Fixed
DateIntervalvalidation when created from an integer.
Remove
- support for PHP 5.3
Please refers to the documentation or the library CHANGELOG for more details
version 2.4.0 - 2014-12-18
- Added
Period::diff - Added support for the
DateTimeInterface
Please refers to the documentation or the library CHANGELOG for more details
version 2.3.0 - 2014-12-15
- Added :
Period::createFromDurationBeforeEnd - Bug Fixed :
Period::isBeforeandPeriod::isAfter - Internal code improved
Please refers to the documentation or the library CHANGELOG for more details
version 2.2.0 - 2014-12-12
Added new methods
Period::gapPeriod::abutsPeriod::isAfterPeriod::isBefore
Fixed methods
Period::overlapsbug from issue #8
Please refers to the documentation or the library CHANGELOG for more details
version 2.1.0 - 2014-12-08
Added
- Modifying methods:
Period::nextPeriod::previous
Period::__toStringusing ISO8601 representation
version 2.0.0 - 2014-10-15
Added
- Change vendor namespace from
PeriodtoLeague\Period - Comparing methods:
Period::sameValueAs,Period::compareDuration,Period::durationGreaterThan,Period::durationLessThan,Period::sameDurationAs,Period::durationDiff
- Modifying methods:
Period::add,Period::sub,Period::intersect
Fixed
Period::containsnow works withPeriodobjectsPeriod::getDurationaccept an optional parameter$get_as_secondsif used and set totrue, the method will return a integer which represents the duration in seconds.Period::mergenow accepts one or morePeriodobjects to return thePeriodobject which contains all submittedPeriodobjects.
version 1.0.1 - 2014-10-08
- The
$intervalparameter can also be an integer interpreted as the number of seconds after which the period must be considered finished.
version 1.0.0 - 2014-09-24
First stable release
version 0.3.0 - 2014-09-22
- Added methods
overlapsandmerge - namespace simplification
version 0.2.1 - 2014-09-22
bug fixes
version 0.2.0 - 2014-09-22
Class name changed from ReportingPeriod to Period
- added the following methods
contains,getRange,setDurationandgetDuration - name consistency applied by removing the (Date reference)
you can feed:
- a
DateTimeor a string when aDateTimeis expected - a
DateIntervalor a string when aDateIntervalis expected
version 0.1.0 - 2014-09-19
Initiale release