Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Period Laravel Package

spatie/period

Immutable date period objects for PHP with powerful comparison tools. Create periods from any DateTime (including Carbon), then calculate overlaps, gaps, intersections, differences, containment, and other complex comparisons across two or many periods.

View on GitHub
Deep Wiki
Context7
2.4.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/period/compare/2.3.5...2.4.0

2.3.5

Revert previous release

2.3.2
2.3.1
2.3.0
  • Add PeriodCollection::sort() (#97)
2.2.0
  • Add PeriodCollection::unique() (#96)
2.1.3
  • Don't initialize Period::asString in constructor
2.1.2
  • Fix subtraction of empty PeriodCollection
2.1.1
  • Reindex collection array after filtering values (#87)
2.1.0
  • Add PeriodCollection::subtract(PeriodCollection|Period $others) (#84)
  • Rename parameter PeriodCollection::overlap(PeriodCollection $others)
  • Rename parameter PeriodCollection::overlapAll(PeriodCollection ...$others)
2.0.0
  • Bump required PHP version to ^8.0
  • Fix bug with overlapAll when no overlap
  • All period properties are now typed, this affects you if you extend from Period or PeriodCollection
  • Return types of several methods have been changed from Period to static
  • Period::duration() returns an instance of PeriodDuration
  • Period::length() now uses the Period's precision instead of always returning days
  • Period::overlap() renamed to Period::overlapAny()
  • Period::overlapSingle() renamed to Period::overlap()
  • Period::diff() renamed to Period::subtract()
  • Period::subtract() (previously diff) no longer returns the gap when there's no overlap
  • Period::diffSingle() renamed to Period::diffSymmetric()
  • Period::contains() now accepts both DateTimeInterface and Period
  • PeriodCollection::overlap() now accepts one or several periods
  • Renamed all getters like getIncludedEnd() and getStart() to includedEnd() and start(), etc.
  • Add Period::fromString()
  • Add Period::asString()
1.6.0
  • Add Period::renew (#74)
1.5.3
  • PHP8 compatibility
1.5.2
  • Keep timezone when boundaries are timezoned (#71)
1.5.1
  • Support multiple precisions when checking touchesWith (#68)
1.5.0
  • Add filter to PeriodCollection
1.4.5
  • Fix for PeriodCollection::gaps() with excluded boundaries (#58)
1.4.4
  • Performance improvement in Period::contains() (#46) edit: this change wasn't merged and targeted at 2.0
1.4.3
  • Improve iterator performance (#42) edit: this change wasn't merged and targeted at 2.0
1.4.2
  • Allow extension of Period that forces extension of DateTimeImmutable (#38)
1.4.1
  • Support PeriodCollection::make()
  • Improved PeriodCollection doc blocks
1.4.0
  • Add map and reduce to PeriodCollection
1.3.1
  • Remove unused code
1.3.0
  • Add period collection add
1.2.0
  • Add period collection intersect
1.1.3
  • Even better docblock support for static return types
1.1.2
  • Better docblock support for static return types
1.1.1
  • Fix bug with null element in diff
1.1.0
  • Make Period iterable
1.0.0
  • First stable release
0.5.1
  • Fix bug with precision not being correctly copied
0.5.0
  • Add boundary and precision support
0.4.1
  • No overlap returns empty collection
0.4.0
  • Add visualizer
0.3.3
  • Support edge case for two period diffs
0.3.2
  • Add better return types to support inherited periods
0.3.0
  • Add Period::contains
0.2.0
  • Initial dev release
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport