All notable changes to Period
will be documented in this file
5.3.2 - 2024-03-23
- None
- Fix package to avoid PHP8.4 deprecation warnings
- None
- None
5.3.1 - 2023-12-06
- None
- None
- None
5.3.0 - 2023-11-28
Chart\LetterCase::convert
- Handles gracefully new Date exception in PHP8.3
- None
- None
5.2.1 - 2023-02-25
- None
Period::fromRange
should work in PHP8.1 with DatePeriod limitations.
InitialDatePresence
use insteadPeriod::fromRange
- None
5.2.0 - 2023-02-18
Period::rangeForward
allows iteration over a set of dates and times, recurring at regular intervals, over the instance forward starting from the instance start.Period::rangeBackwards
Allows iteration over a set of dates and times, recurring at regular intervals, over the instance backwards starting from the instance ending.Period::fromRange
returns a newPeriod
instance from aDatePeriod
object. Only usable in PHP8.2+ installation
- Using PHPUnit 10 instead of PHPUnit 9.
Period::dateRangeForward
use insteadPeriod::rangeForward
Period::dateRangeBackwards
use insteadPeriod::rangeBackwards
- None
5.1.0 - 2022-06-28
DatePoint::fromFormat
to instantiate from a date format and its related string.
Period::fromIso8601
now supports truncated date and duration in the interval string.
- None
- None
5.0.0 - 2022-02-22
IntervalError
used as the error interface marker.InvalidInterval
exception for anything regarding creating an object.Duration::fromSeconds
uses a dedicated fraction parameter and the seconds are no longer expressed using afloat
value.Period::fromTimestamp
to instantiate a time range object from two timestamps.Period::fromIso80000
to instantiate a time range object from a mathematical representation and a date format.Period::fromBourbaki
to instantiate a time range object from a mathematical representation and a date format.Period
duration comparison methods accepts alsoDuration
andDateInterval
in addition toPeriod
objects.Period::union
Period::snapTo*
methods to ease period expansion.Period::meets
Period::meetsOnStart
Period::meetsOnEnd
Period::toBourbaki
Period::toIso80000
Period::toBourbaki
Bounds
Enumeration.InitialDatePresence
Enumeration.Sequence::toList
Chart\LetterCase
Enumeration.Chart\Alignment
Enumeration.Chart\StreamOutput
class to replaceChart\ConsoleOutput
class.Chart\Terminal
Enumeration.Chart\ChartError
used as the chart error interface marker.Chart\UnableToDrawChart
exception for anything regarding drawing a chart out ofPeriod
and/orSequence
objects.
- Switch from using
Closure
object instead of thecallable
pseudo type with theSequence
methods. Period::diff
returns aSequence
instance instead of an array.Period::__construct
is private.Period
named constructors, all parameters are required except for the boundaries.Period::timeDuration
now returns anint
instead of afloat
value.Period::intersect
now can take multiplePeriod
instances as parameters.Period::subtract
now can take multiplePeriod
instances as parameters.Duration
no longer extends aDateInterval
object.Duration::fromIsoString
supports 3 versions of dealing with fractions with ISO valid string.Datepoint
class renamedDatePoint
.DatePoint
no longer extends aDateTimeImmutable
object.- Argument names are normalized throughout the package. (PHP8 BC break)
Chart\LatinLetter
in case of wrong value will fall back toA
instead of0
which is not a letter.Chart\LatinLetter
the starting label must be explicit on instantiation.Chart\RomanNumber
requires its two arguments to be explicitly set.
- None
- Support for PHP7 and PHP8.0
Period::fromDatepoint
replaced byPeriod::fromDate
Period::getStartDate
replaced by accessing readonly propertyPeriod::startDate
Period::getEndDate
replaced by accessing readonly propertyPeriod::endDate
Period::getBoundaryType
replaced by accessing readonly propertyPeriod::bounds
Period::getDateInterval
replaced byPeriod::dateInterval
Period::getTimestampInterval
replaced byPeriod::timeDuration
Period::withBoundaryType
replaced byPeriod::boundedBy
Period::isStartIncluded
with no replacement useBounds::isStartIncluded
Period::isStartExcluded
with no replacement useBounds::isStartIncluded
insteadPeriod::isEndIncluded
with no replacement useBounds::isEndIncluded
Period::isEndExcluded
with no replacement useBounds::isEndIncluded
insteadPeriod::fromDatePeriod
replaced byPeriod::fromDateRange
Period::getDatePeriod
replaced byPeriod::dateRange
Period::getDatePeriodBackwards
replaced byPeriod::dateRangeBackwards
Period::__string
replaced byPeriod::toIso8601
Period::format
replaced byPeriod::toIso80000
Period::split
replaced byPeriod::splitForward
Period::substract
usePeriod::subtract
insteadSequence::substract
useSequence::subtract
insteadSequence::getIntersections
useSequence::intersections
insteadSequence::getGaps
useSequence::gaps
insteadSequence::getBoundaries
useSequence::length
insteadSequence::getTotalTimestampInterval
useSequence::totalTimeDuration
insteadSequence::toArray
useSequence::toList
insteadDuration::__toString
andDuration::format
with no replacementDuration::create
is removed with no replacementDatepoint::create
is removed with no replacement- The
create
prefix is removed from theDuration
andDatepoint
named 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\ConsoleOutput
replaced byChart\StreamOutput
class.Chart\RomanNumber::isLower
useChart\LetterCase::isUpper
instead.Chart\RomanNumber::startingAt
useChart\DecimalNumber::startLabel
public readonly propertyChart\RomanNumber::startsWith
is removed with no replacementChart\RomanNumber::withLetterCase
is removed with no replacementChart\DecimalNumber::startsWith
is removed with no replacementChart\LatinNumber::startsWith
is removed with no replacementChart\LatinNumber::startingAt
useChart\LatinNumber::startLabel
public readonly propertyChart\AffixLabel::withPrefix
is removed with no replacementChart\AffixLabel::withSuffix
is removed with no replacementChart\AffixLabel::prefix
method useChart\AffixLabel::labelPrefix
public readonly propertyChart\AffixLabel::suffix
method useChart\AffixLabel::labelSuffix
public readonly property
Removed all the following namespaced functions from the package:
League\Period\datepoint
League\Period\duration
League\Period\year
League\Period\semester
League\Period\quarter
League\Period\month
League\Period\day
League\Period\hour
League\Period\minute
League\Period\second
League\Period\instant
League\Period\iso_year
League\Period\iso_week
League\Period\interval_after
League\Period\interval_before
League\Period\interval_around
League\Period\interval_from_dateperiod
4.12.0 - 2022-02-21
Datepoint::second
Datepoint::minute
Datepoint::hour
Datepoint::isoWeek
Datepoint::month
Datepoint::quarter
Datepoint::semester
Datepoint::year
Datepoint::isoYear
Duration::fromDateInterval
Duration::fromSeconds
Duration::fromChronoString
Duration::fromTimeString
Duration::fromDateString
Period::timeDuration
Period::dateInterval
Period::dateRangeForward
Period::dateRangeBackwards
Period::toIso80000
Period::splitForward
Period::timeDurationDiff
Period::boundedBy
Sequence::length
Sequence::totalTimeDuration
- None
Datepoint::getSecond
is deprecated in favor ofDatepoint::second
Datepoint::getMinute
is deprecated in favor ofDatepoint::minute
Datepoint::getHour
is deprecated in favor ofDatepoint::hour
Datepoint::getIsoWeek
is deprecated in favor ofDatepoint::isoWeek
Datepoint::getMonth
is deprecated in favor ofDatepoint::month
Datepoint::getQuarter
is deprecated in favor ofDatepoint::quarter
Datepoint::getSemester
is deprecated in favor ofDatepoint::semester
Datepoint::getYear
is deprecated in favor ofDatepoint::year
Datepoint::getIsoYear
is deprecated in favor ofDatepoint::isoYear
Duration::createfromDateInterval
is deprecated in favor ofDatepoint::fromDateInterval
Duration::createfromSeconds
is deprecated in favor ofDatepoint::fromSeconds
Duration::createfromChronoString
is deprecated in favor ofDatepoint::fromChronoString
Duration::createfromTimeString
is deprecated in favor ofDatepoint::fromTimeString
Duration::createfromDateString
is deprecated in favor ofDatepoint::fromDateString
Period::getTimestampInterval
is deprecated in favor ofPeriod::timeDuration
Period::getDateInterval
is deprecated in favor ofPeriod::dateInterval
Period::getDatePeriod
is deprecated in favor ofPeriod::dateRangeForward
Period::getDatePeriodBackwards
is deprecated in favor ofPeriod::dateRangeBackwards
Period::format
is deprecated in favor ofPeriod::toIso80000
Period::split
is deprecated in favor ofPeriod::splitForward
Period::withBoundaryType
is deprecated in favor ofPeriod::boundedBy
Period::timestampIntervalDiff
is deprecated in favor ofPeriod::timeDurationDiff
Sequence::boundaries
is deprecated in favor ofSequence::length
Sequence::getTotalTimestampInterval
is deprecated in favor ofSequence::totalTimeDuration
- None
4.11.0 - 2020-11-11
Period::fromDatepoint
Duration::createFromDateInterval
Duration::createFromTimeString
Duration::createFromChronoString
Duration::createFromSeconds
Duration::create
supports DateInterval spec strings.- Support for PHP8
Duration::create
when using a float will now overflow the results up to the Hour unit.
- None
- None
4.10.0 - 2020-03-22
Period::toIso8601
- Charts featuring ported from Bakame\Period\Vizualizer
- Fix issue with
Sequence::intersections
method.
Period::__string
replaced byPeriod::toIso8601
- Support for PHP7.1
4.9.0 - 2019-09-02
-
$boundaryType
argument added to the following named constructors:Period::fromDay
Period::fromIsoWeek
Period::fromMonth
Period::fromQuarter
Period::fromSemester
Period::fromYear
Period::fromIsoYear
-
Period::subtract
-
Sequence::subtract
- None
Period::substract
usePeriod::subtract
insteadSequence::substract
useSequence::subtract
instead
- None
4.8.1 - 2019-07-16
- None
Sequence
negative offsets for a object with only onePeriod
instance issue #85
- None
- None
4.8.0 - 2019-06-20
Datepoint
methods returningPeriod
objects supports boundaryTypePeriod::merge
supports empty arguments.Sequence::contains
supports empty arguments.Sequence::unshift
supports empty arguments.Sequence::push
supports empty arguments.Sequence
class supports negative offsets.
Duration::adjustedTo
no longer comparesDateInterval
objects to be compatible with PHP7.4+
- None
- None
4.7.1 - 2019-05-19
- None
- Improve
Duration::createFromDateString
bug fix to take into account DateInterval::createFromDateString bug fix - Update the development tools to Infection 0.13
- None
- None
4.7.0 - 2019-03-31
Sequence::getTotalTimestampInterval
see PR #79Period::substract
see PR #80Sequence::substract
see PR #81
- Update
Duration::createFromDateString
to take into account DateInterval::createFromDateString bug fix - Update the development tools to PHPUnit8.0 and PHPstan 0.11
- None
- None
4.6.0 - 2019-03-06
Duration::adjustedTo
- Internals: added support for PHP7.4 and PHP8.0 in travis.yml
- None
Duration::withoutCarryOver
useDuration::adjustedTo
instead
- None
4.5.0 - 2019-02-03
Datepoint::isBefore
Datepoint::bordersOnStart
Datepoint::isStarting
Datepoint::isDuring
Datepoint::isEnding
Datepoint::bordersOnEnd
Datepoint::isAfter
Datepoint::abuts
Duration::create
now supports chronometer formatDuration::withoutCarryOver
Period::durationCompare
to take into account Timezone and DST
Duration::__toString
useDuration::format
instead
- None
4.4.0 - 2019-01-20
- Added support for the boundary type
Period::EXCLUDE_START_INCLUDE_END
Period::INCLUDE_START_EXCLUDE_END
Period::EXCLUDE_ALL
Period::INCLUDE_ALL
Period::getBoundaryType
Period::isStartExcluded
Period::isStartIncluded
Period::isEndExcluded
Period::isEndIncluded
Period::withBoundaryType
Period::__construct
adds the$boundaryType
argument;Period::after
adds the$boundaryType
argument;Period::before
adds the$boundaryType
argument;Period::around
adds the$boundaryType
argument;Period::fromDatePeriod
adds the$boundaryType
argument;
- Added missing Allen's Algebra intervals
Period::bordersOnStart
Period::bordersOnEnd
Period::isDuring
Period::isStartedBy
Period::isEndedBy
- Added additional methods to the Sequence class
Sequence::unions
Sequence::intersections
Sequence::gaps
Sequence::boundaries
Sequence::reduce
- None
Sequence::getIntersections
useSequence::intersections
insteadSequence::getGaps
useSequence::gaps
insteadSequence::getBoundaries
useSequence::boundaries
instead
- None
4.3.1 - 2019-01-07
- None
Datepoint::createFromFormat
see issue #72
- None
- None
4.3.0 - 2018-12-21
Sequence
implements theArrayAccess
interface
Sequence::map
must preserve offset index after modification.
- None
- None
4.2.0 - 2018-12-19
League\Period\Datepoint
League\Period\Duration
Period::fromIsoYear
Period::fromYear
Period::fromSemester
Period::fromQuarter
Period::fromMonth
Period::fromIsoWeek
Period::fromDay
Period::after
Period::before
Period::around
Period::fromDatePeriod
Sequence::map
- None
League\Period\datepoint
League\Period\duration
League\Period\year
League\Period\semester
League\Period\quarter
League\Period\month
League\Period\day
League\Period\hour
League\Period\minute
League\Period\second
League\Period\instant
League\Period\iso_year
League\Period\iso_week
League\Period\interval_after
League\Period\interval_before
League\Period\interval_around
League\Period\interval_from_dateperiod
- None
4.1.0 - 2018-12-07
League\Period\Sequence
League\Period\InvalidIndex
- None
- None
- None
4.0.1 - 2018-11-30
- None
Period::split
does not work with daylight saving see issue #68
- None
- None
4.0.0 - 2018-10-18
Exception
class
Period::durationCompare
Period::durationEquals
Period::format
Period::expand
Period::equals
Period::getDatePeriodBackwards
League\Period\datepoint
League\Period\duration
League\Period\year
League\Period\semester
League\Period\quarter
League\Period\month
League\Period\day
League\Period\hour
League\Period\minute
League\Period\second
League\Period\instant
League\Period\iso_year
League\Period\iso_week
League\Period\interval_after
League\Period\interval_before
League\Period\interval_around
League\Period\interval_from_dateperiod
- The
Period
class is now final Period::JsonSerialize
now returns datepoint in JavaScript compatible notationPeriod::diff
always returns an array containing two values.- An instance with a duration equals to
DateInterval('PT0S')
will contains no datepoint not even its starting datepoint.
- None
- Support for PHP
7.0
Period::next
Period::previous
Period::add
Period::sub
Period::createFromYear
replaced byLeague\Period\year
Period::createFromMonth
replaced byLeague\Period\month
Period::createFromWeek
replaced byLeague\Period\iso_week
Period::createFromDay
replaced byLeague\Period\day
Period::createFromSemester
replaced byLeague\Period\semester
Period::createFromQuarter
replaced byLeague\Period\quarter
Period::createFromDuration
replaced byLeague\Period\interval_after
Period::createFromDurationBeforeEnd
replaced byLeague\Period\interval_before
Period::sameValueAs
replaced byPeriod::equals
Period::sameDurationAs
replaced byPeriod::durationEquals
Period::compareDuration
replaced byPeriod::durationCompare
Period::withDuration
replaced byPeriod::withDurationAfterStart
3.4.0 - 2017-11-17
Period::withDurationBeforeEnd
Period::splitBackwards
- None
- None
- None
3.3.0 - 2016-09-19
Period::move
Period::moveStartDate
Period::moveEndDate
- None
Period::add
you should usePeriod::moveEndDate
insteadPeriod::sub
you should usePeriod::moveEndDate
instead
- None
3.2.0 - 2016-05-09
Period::__set_state
- autoloader to use the library without composer
- None
- None
3.1.1 - 2016-02-10
- None
Period::contains
see issue #31- microseconds are taken into account when converting
DateTimeInterface
objects.
- None
- None
3.1.0 - 2016-02-01
Period::createFromDay
Period::getDatePeriod
adding the$option
parameterDateTime
toDateTimeImmutable
convertion improved for PHP 5.6+ version- Bumped version requirement to PHP 5.5.9 because of a bug in
DatePeriod
constructor
- None
- None
3.0.1 - 2015-12-21
- None
Period::contains
see issue #28
- None
- None
3.0.0 - 2015-09-02
Period
implements theJsonSerializable
interfacePeriod
can now be extended
Period
always returnsDateTimeImmutable
objectsPeriod::split
returns aGenerator
Period::merge
no longer throwsRuntimeException
- None
- support for PHP 5.4
Period::getStart
Period::getEnd
Period::getRange
Period::duration
Period::durationDiff
2.5.1 - 2015-03-06
Period
always returnsDateTime
objects even when givenDateTimeImmutable
objects.
2.5.0 - 2015-03-06
Period::split
to split aPeriod
object into smallerPeriod
objectsPeriod::getDatePeriod
Period::getDateInterval
Period::getTimestampInterval
Period::getStartDate
Period::getEndDate
Period::dateIntervalDiff
Period::timestampIntervalDiff
DateInterval
validation when created from an integer.
Period::getStart
you should usePeriod::getStartDate
insteadPeriod::getEnd
you should usePeriod::getEndDate
insteadPeriod::getRange
you should usePeriod::getDatePeriod
insteadPeriod::duration
you should usePeriod::getDateInterval
orPeriod::getTimestampInterval
insteadPeriod::durationDiff
you should usePeriod::dateIntervalDiff
orPeriod::timestampIntervalDiff
instead
- support for PHP 5.3
2.4.0 - 2014-12-18
- Modifying methods:
Period::diff
- Added support for
DateTimeInterface
interface
2.3.0 - 2014-12-15
- Named constructor:
Period::createFromDurationBeforeEnd
Period::isBefore
Period::isAfter
bug fixed. must take into account the half-open implementation of aPeriod
object.
2.2.0 - 2014-12-12
- Modifying methods:
Period::gap
- Comparing methods:
Period::abuts
Period::isAfter
Period::isBefore
Period::overlaps
bug fixed issue #8
2.1.0 - 2014-12-08
- Modifying methods:
Period::next
Period::previous
Period::__toString
using ISO8601 representation
2.0.0 - 2014-10-15
- Change vendor namespace from
Period
toLeague\Period
- Comparing methods:
Period::sameValueAs
,Period::compareDuration
,Period::durationGreaterThan
,Period::durationLessThan
,Period::sameDurationAs
,Period::durationDiff
- Modifying methods:
Period::add
,Period::sub
,Period::intersect
Period::contains
now works withPeriod
objectsPeriod::getDuration
accept an optional parameter$get_as_seconds
if used and set totrue
, the method will return a integer which represents the duration in seconds.Period::merge
now accepts one or morePeriod
objects to return thePeriod
object which contains all submittedPeriod
objects.
1.0.1 - 2014-10-08
- The
$interval
parameter can also an integer which represents the interval expressed in seconds.
1.0.0 - 2014-09-24
First stable release of Period
0.3.0 - 2014-09-22
- Added methods overlaps and merge
- namespace simplification
0.2.1 - 2014-09-22
- bug fixes
0.2.0 - 2014-09-22
Class name changed from ReportingPeriod
to Period
- added the following methods
contains
,getRange
,setDuration
andgetDuration
- name consistency applied by removing the (Date reference)
you can feed:
- a
DateTime
or a string when aDateTime
is expected - a
DateInterval
or a string when aDateInterval
is expected