league/period
Time range API for PHP
5.3.3
6.0M downloads/mo
#2048 most downloaded on Packagist
thephpleague/period
What this package is like to depend on
Last release 10 months ago
17 Oct 2025
Release timing varies
gaps range from 8 days to 1.6 years
Nearly every release is documented
notes for 45 of 45 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
45 releases · first in 2014
1 release in the last 12 months
see the full history below
Release timeline
45 releases · Sep 2014 to Oct 2025Releases
latest 45-
5.3.317 Oct 2025Release notes
Open source →Added
- None
Fixed
- Fix inconsistent behaviour for
isBefore()when comparing periods with other periods or dates #138 thanks @brummbar
Deprecated
- None
Removed
- None
Release notes
Open source →Added
- None
Fixed
- Fix inconsistent behaviour for
isBefore()when comparing periods with other periods or dates #138 thanks @brummbar
Deprecated
- None
Removed
- None
-
5.3.223 Mar 2024Release notes
Open source →Added
- None
Fixed
- Fix package to avoid PHP8.4 deprecation warnings
Deprecated
- None
Removed
- None
Release notes
Open source →Added
- None
Fixed
- Fix package to avoid PHP8.4 deprecation warnings
Deprecated
- None
Removed
- None
-
5.3.106 Dec 2023 -
5.3.028 Nov 2023Release notes
Open source →Added
Chart\LetterCase::convert
Fixed
- Handles gracefully new Date exception in PHP8.3
Deprecated
- None
Removed
- None
Release notes
Open source →Added
Chart\LetterCase::convert
Fixed
- Handles gracefully new Date exception in PHP8.3
Deprecated
- None
Removed
- None
-
5.2.125 Feb 2023Release notes
Open source →Added
- None
Fixed
Period::fromRangeshould work in PHP8.1 withDatePeriodlimitations.
Deprecated
InitialDatePresenceuse insteadPeriod::fromRange
Removed
- None
Release notes
Open source →Added
- None
Fixed
Period::fromRangeshould work in PHP8.1 with DatePeriod limitations.
Deprecated
InitialDatePresenceuse insteadPeriod::fromRange
Removed
- None
-
5.2.018 Feb 2023Release notes
Open source →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
Release notes
Open source →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
-
5.1.029 Jun 2022Release notes
Open source →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
Release notes
Open source →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
-
5.0.022 Feb 2022Release notes
Open source →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
Release notes
Open source →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
-
4.12.021 Feb 2022Release notes
Open source →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
Release notes
Open source →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
-
4.11.011 Nov 2020Release notes
Open source →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
Release notes
Open source →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
-
4.10.022 Mar 2020Release notes
Open source →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
-
4.9.002 Sep 2019Release notes
Open source →Added
-
$boundaryTypeargument added to the following named constructors:Period::fromDayPeriod::fromIsoWeekPeriod::fromMonthPeriod::fromQuarterPeriod::fromSemesterPeriod::fromYearPeriod::fromIsoYear
-
Period::subtract -
Sequence::subtract
Fixed
- None
Deprecated
Period::substractusePeriod::subtractinsteadSequence::substractuseSequence::subtractinstead
Removed
- None
-
-
4.8.116 Jul 2019Release notes
Open source →Added
- None
Fixed
Sequencenegative offsets for a object with only onePeriodinstance issue #85
Deprecated
- None
Removed
- None
-
4.8.020 Jun 2019Release notes
Open source →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
-
4.7.119 May 2019Release notes
Open source →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
-
4.7.031 Mar 2019Release notes
Open source →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
-
4.6.006 Mar 2019Release notes
Open source →Added
Duration::adjustedTo- Internals: added support for PHP7.4 and PHP8.0 in travis.yml
Fixed
- None
Deprecated
Duration::withoutCarryOveruseDuration::adjustedToinstead
Removed
- None
-
4.5.003 Feb 2019Release notes
Open source →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
-
4.4.020 Jan 2019Release notes
Open source →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
- Added support for the boundary type
-
4.3.107 Jan 2019Release notes
Open source → -
4.3.021 Dec 2018Release notes
Open source →Added
Sequenceimplements theArrayAccessinterface
Fixed
Sequence::mapmust preserve offset index after modification.
Deprecated
- None
Removed
- None
-
4.2.019 Dec 2018Release notes
Open source →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
-
4.1.007 Dec 2018Release notes
Open source →Added
League\Period\SequenceLeague\Period\InvalidIndex
Fixed
- None
Deprecated
- None
Removed
- None
-
4.0.130 Nov 2018Release notes
Open source →Added
- None
Fixed
Period::splitdoes not work with daylight saving see issue #68
Deprecated
- None
Removed
- None
-
4.0.018 Oct 2018Release notes
Open source →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
-
3.4.017 Nov 2017Release notes
Open source →Added
Period::withDurationBeforeEndPeriod::splitBackwards
Fixed
- None
Deprecated
- None
Removed
- None
-
3.3.019 Sep 2016Release notes
Open source →Added
Period::movePeriod::moveStartDatePeriod::moveEndDate
Fixed
- None
Deprecated
Period::addyou should usePeriod::moveEndDateinsteadPeriod::subyou should usePeriod::moveEndDateinstead
Removed
- None
-
3.2.009 May 2016Release notes
Open source →Added
Period::__set_state- autoloader to use the library without composer
Fixed
Deprecated
- None
Removed
- None
-
3.1.110 Feb 2016Release notes
Open source →Added
- None
Fixed
Period::containssee issue #31- microseconds are taken into account when converting
DateTimeInterfaceobjects.
Deprecated
- None
Removed
- None
-
3.1.001 Feb 2016Release notes
Open source →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
-
3.0.121 Dec 2015Release notes
Open source → -
3.0.002 Sep 2015Release notes
Open source →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
-
2.5.106 Mar 2015Release notes
Open source →Fixed
Periodalways returnsDateTimeobjects even when givenDateTimeImmutableobjects.
-
2.5.006 Mar 2015Release notes
Open source →Added
Period::splitto split aPeriodobject into smallerPeriodobjectsPeriod::getDatePeriodPeriod::getDateIntervalPeriod::getTimestampIntervalPeriod::getStartDatePeriod::getEndDatePeriod::dateIntervalDiffPeriod::timestampIntervalDiff
Fixed
DateIntervalvalidation when created from an integer.
Deprecated
Period::getStartyou should usePeriod::getStartDateinsteadPeriod::getEndyou should usePeriod::getEndDateinsteadPeriod::getRangeyou should usePeriod::getDatePeriodinsteadPeriod::durationyou should usePeriod::getDateIntervalorPeriod::getTimestampIntervalinsteadPeriod::durationDiffyou should usePeriod::dateIntervalDifforPeriod::timestampIntervalDiffinstead
Remove
- support for PHP 5.3
-
2.4.018 Dec 2014Release notes
Open source →Added
- Modifying methods:
Period::diff
Fixed
- Added support for
DateTimeInterfaceinterface
- Modifying methods:
-
2.3.015 Dec 2014Release notes
Open source →Added
- Named constructor:
Period::createFromDurationBeforeEnd
Fixed
Period::isBeforePeriod::isAfterbug fixed. must take into account the half-open implementation of aPeriodobject.
- Named constructor:
-
2.2.012 Dec 2014Release notes
Open source →Added
- Modifying methods:
Period::gap
- Comparing methods:
Period::abutsPeriod::isAfterPeriod::isBefore
Fixed
Period::overlapsbug fixed issue #8
- Modifying methods:
-
2.1.008 Dec 2014Release notes
Open source →Added
- Modifying methods:
Period::nextPeriod::previous
Period::__toStringusing ISO8601 representation
- Modifying methods:
-
2.0.015 Oct 2014Release notes
Open source →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.
- Change vendor namespace from
-
1.0.108 Oct 2014Release notes
Open source →Fixed
- The
$intervalparameter can also an integer which represents the interval expressed in seconds.
- The
-
1.0.024 Sep 2014 -
0.3.022 Sep 2014 -
0.2.122 Sep 2014 -
0.2.022 Sep 2014Release notes
Open source →Class name changed from
ReportingPeriodtoPeriod- 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
- added the following methods
-
0.1.019 Sep 2014Release notes
Open source →