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

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/period/compare/2.3.1...2.3.2

1.6.1
2.3.1

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/period/compare/2.3.0...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
1.5.1
1.5.0

Add filter to PeriodCollection

1.4.5
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.1
1.3.0
1.2.0
1.1.3
1.1.2
  • Better docblock support for static return types
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.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope